2021-01-15 09:56:44 +00:00
|
|
|
error: calls to `push` immediately after creation
|
|
|
|
--> $DIR/vec_init_then_push.rs:5:5
|
|
|
|
|
|
|
|
|
LL | / let mut def_err: Vec<u32> = Default::default();
|
|
|
|
LL | | def_err.push(0);
|
2022-05-21 11:24:00 +00:00
|
|
|
| |____________________^ help: consider using the `vec![]` macro: `let def_err: Vec<u32> = vec![..];`
|
2021-01-15 09:56:44 +00:00
|
|
|
|
|
|
|
|
= note: `-D clippy::vec-init-then-push` implied by `-D warnings`
|
|
|
|
|
|
|
|
error: calls to `push` immediately after creation
|
|
|
|
--> $DIR/vec_init_then_push.rs:8:5
|
|
|
|
|
|
|
|
|
LL | / let mut new_err = Vec::<u32>::new();
|
|
|
|
LL | | new_err.push(1);
|
|
|
|
| |____________________^ help: consider using the `vec![]` macro: `let mut new_err = vec![..];`
|
|
|
|
|
|
|
|
error: calls to `push` immediately after creation
|
|
|
|
--> $DIR/vec_init_then_push.rs:11:5
|
|
|
|
|
|
|
|
|
LL | / let mut cap_err = Vec::with_capacity(2);
|
|
|
|
LL | | cap_err.push(0);
|
|
|
|
LL | | cap_err.push(1);
|
|
|
|
LL | | cap_err.push(2);
|
|
|
|
| |____________________^ help: consider using the `vec![]` macro: `let mut cap_err = vec![..];`
|
|
|
|
|
|
|
|
error: calls to `push` immediately after creation
|
2021-02-25 10:25:22 +00:00
|
|
|
--> $DIR/vec_init_then_push.rs:23:5
|
2021-01-15 09:56:44 +00:00
|
|
|
|
|
|
|
|
LL | / new_err = Vec::new();
|
|
|
|
LL | | new_err.push(0);
|
|
|
|
| |____________________^ help: consider using the `vec![]` macro: `new_err = vec![..];`
|
|
|
|
|
2022-05-21 11:24:00 +00:00
|
|
|
error: calls to `push` immediately after creation
|
|
|
|
--> $DIR/vec_init_then_push.rs:73:5
|
|
|
|
|
|
|
|
|
LL | / let mut v = Vec::new();
|
|
|
|
LL | | v.push(x);
|
|
|
|
LL | | v.push(1);
|
|
|
|
| |______________^ help: consider using the `vec![]` macro: `let mut v = vec![..];`
|
|
|
|
|
|
|
|
error: calls to `push` immediately after creation
|
|
|
|
--> $DIR/vec_init_then_push.rs:81:5
|
|
|
|
|
|
|
|
|
LL | / let mut v = Vec::new();
|
|
|
|
LL | | v.push(0);
|
|
|
|
LL | | v.push(1);
|
|
|
|
LL | | v.push(0);
|
|
|
|
... |
|
|
|
|
LL | | v.push(1);
|
|
|
|
LL | | v.push(0);
|
|
|
|
| |______________^ help: consider using the `vec![]` macro: `let mut v = vec![..];`
|
|
|
|
|
|
|
|
error: calls to `push` immediately after creation
|
|
|
|
--> $DIR/vec_init_then_push.rs:94:5
|
|
|
|
|
|
|
|
|
LL | / let mut v2 = Vec::new();
|
|
|
|
LL | | v2.push(0);
|
|
|
|
LL | | v2.push(1);
|
|
|
|
LL | | v2.push(0);
|
|
|
|
... |
|
|
|
|
LL | | v2.push(1);
|
|
|
|
LL | | v2.push(0);
|
|
|
|
| |_______________^ help: consider using the `vec![]` macro: `let mut v2 = vec![..];`
|
|
|
|
|
|
|
|
error: aborting due to 7 previous errors
|
2021-01-15 09:56:44 +00:00
|
|
|
|