1 error: slow zero-filling initialization
2 --> $DIR/slow_vector_initialization.rs:13:5
4 LL | let mut vec1 = Vec::with_capacity(len);
5 | ----------------------- help: consider replace allocation with: `vec![0; len]`
6 LL | vec1.extend(repeat(0).take(len));
7 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
9 = note: `-D clippy::slow-vector-initialization` implied by `-D warnings`
11 error: slow zero-filling initialization
12 --> $DIR/slow_vector_initialization.rs:17:5
14 LL | let mut vec2 = Vec::with_capacity(len - 10);
15 | ---------------------------- help: consider replace allocation with: `vec![0; len - 10]`
16 LL | vec2.extend(repeat(0).take(len - 10));
17 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
19 error: slow zero-filling initialization
20 --> $DIR/slow_vector_initialization.rs:31:5
22 LL | let mut resized_vec = Vec::with_capacity(30);
23 | ---------------------- help: consider replace allocation with: `vec![0; 30]`
24 LL | resized_vec.resize(30, 0);
25 | ^^^^^^^^^^^^^^^^^^^^^^^^^
27 error: slow zero-filling initialization
28 --> $DIR/slow_vector_initialization.rs:34:5
30 LL | let mut extend_vec = Vec::with_capacity(30);
31 | ---------------------- help: consider replace allocation with: `vec![0; 30]`
32 LL | extend_vec.extend(repeat(0).take(30));
33 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
35 error: slow zero-filling initialization
36 --> $DIR/slow_vector_initialization.rs:41:5
38 LL | let mut vec1 = Vec::with_capacity(len);
39 | ----------------------- help: consider replace allocation with: `vec![0; len]`
40 LL | vec1.resize(len, 0);
43 error: slow zero-filling initialization
44 --> $DIR/slow_vector_initialization.rs:49:5
46 LL | let mut vec3 = Vec::with_capacity(len - 10);
47 | ---------------------------- help: consider replace allocation with: `vec![0; len - 10]`
48 LL | vec3.resize(len - 10, 0);
49 | ^^^^^^^^^^^^^^^^^^^^^^^^
51 error: slow zero-filling initialization
52 --> $DIR/slow_vector_initialization.rs:53:5
54 LL | vec1 = Vec::with_capacity(10);
55 | ---------------------- help: consider replace allocation with: `vec![0; 10]`
56 LL | vec1.resize(10, 0);
59 error: aborting due to 7 previous errors