]>
Commit | Line | Data |
---|---|---|
f20569fa XL |
1 | error: slow zero-filling initialization |
2 | --> $DIR/slow_vector_initialization.rs:13:5 | |
3 | | | |
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 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
8 | | | |
9 | = note: `-D clippy::slow-vector-initialization` implied by `-D warnings` | |
10 | ||
11 | error: slow zero-filling initialization | |
12 | --> $DIR/slow_vector_initialization.rs:17:5 | |
13 | | | |
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 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
18 | ||
19 | error: slow zero-filling initialization | |
20 | --> $DIR/slow_vector_initialization.rs:31:5 | |
21 | | | |
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 | | ^^^^^^^^^^^^^^^^^^^^^^^^^ | |
26 | ||
27 | error: slow zero-filling initialization | |
28 | --> $DIR/slow_vector_initialization.rs:34:5 | |
29 | | | |
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 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
34 | ||
35 | error: slow zero-filling initialization | |
36 | --> $DIR/slow_vector_initialization.rs:41:5 | |
37 | | | |
38 | LL | let mut vec1 = Vec::with_capacity(len); | |
39 | | ----------------------- help: consider replace allocation with: `vec![0; len]` | |
40 | LL | vec1.resize(len, 0); | |
41 | | ^^^^^^^^^^^^^^^^^^^ | |
42 | ||
43 | error: slow zero-filling initialization | |
44 | --> $DIR/slow_vector_initialization.rs:49:5 | |
45 | | | |
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 | | ^^^^^^^^^^^^^^^^^^^^^^^^ | |
50 | ||
51 | error: slow zero-filling initialization | |
52 | --> $DIR/slow_vector_initialization.rs:53:5 | |
53 | | | |
54 | LL | vec1 = Vec::with_capacity(10); | |
55 | | ---------------------- help: consider replace allocation with: `vec![0; 10]` | |
56 | LL | vec1.resize(10, 0); | |
57 | | ^^^^^^^^^^^^^^^^^^ | |
58 | ||
59 | error: aborting due to 7 previous errors | |
60 |