]>
Commit | Line | Data |
---|---|---|
f20569fa | 1 | error: slow zero-filling initialization |
add651ee | 2 | --> $DIR/slow_vector_initialization.rs:14:5 |
f20569fa XL |
3 | | |
4 | LL | let mut vec1 = Vec::with_capacity(len); | |
add651ee | 5 | | ----------------------- help: consider replacing this with: `vec![0; len]` |
f20569fa XL |
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 | |
add651ee | 12 | --> $DIR/slow_vector_initialization.rs:18:5 |
f20569fa XL |
13 | | |
14 | LL | let mut vec2 = Vec::with_capacity(len - 10); | |
add651ee | 15 | | ---------------------------- help: consider replacing this with: `vec![0; len - 10]` |
f20569fa XL |
16 | LL | vec2.extend(repeat(0).take(len - 10)); |
17 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
18 | ||
19 | error: slow zero-filling initialization | |
add651ee | 20 | --> $DIR/slow_vector_initialization.rs:25:5 |
064997fb FG |
21 | | |
22 | LL | let mut vec4 = Vec::with_capacity(len); | |
add651ee | 23 | | ----------------------- help: consider replacing this with: `vec![0; len]` |
064997fb FG |
24 | LL | vec4.extend(repeat(0).take(vec4.capacity())); |
25 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
26 | ||
27 | error: slow zero-filling initialization | |
add651ee | 28 | --> $DIR/slow_vector_initialization.rs:35:5 |
f20569fa XL |
29 | | |
30 | LL | let mut resized_vec = Vec::with_capacity(30); | |
add651ee | 31 | | ---------------------- help: consider replacing this with: `vec![0; 30]` |
f20569fa XL |
32 | LL | resized_vec.resize(30, 0); |
33 | | ^^^^^^^^^^^^^^^^^^^^^^^^^ | |
34 | ||
35 | error: slow zero-filling initialization | |
add651ee | 36 | --> $DIR/slow_vector_initialization.rs:38:5 |
f20569fa XL |
37 | | |
38 | LL | let mut extend_vec = Vec::with_capacity(30); | |
add651ee | 39 | | ---------------------- help: consider replacing this with: `vec![0; 30]` |
f20569fa XL |
40 | LL | extend_vec.extend(repeat(0).take(30)); |
41 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
42 | ||
43 | error: slow zero-filling initialization | |
add651ee | 44 | --> $DIR/slow_vector_initialization.rs:45:5 |
f20569fa XL |
45 | | |
46 | LL | let mut vec1 = Vec::with_capacity(len); | |
add651ee | 47 | | ----------------------- help: consider replacing this with: `vec![0; len]` |
f20569fa XL |
48 | LL | vec1.resize(len, 0); |
49 | | ^^^^^^^^^^^^^^^^^^^ | |
50 | ||
51 | error: slow zero-filling initialization | |
add651ee | 52 | --> $DIR/slow_vector_initialization.rs:53:5 |
f20569fa XL |
53 | | |
54 | LL | let mut vec3 = Vec::with_capacity(len - 10); | |
add651ee | 55 | | ---------------------------- help: consider replacing this with: `vec![0; len - 10]` |
f20569fa XL |
56 | LL | vec3.resize(len - 10, 0); |
57 | | ^^^^^^^^^^^^^^^^^^^^^^^^ | |
58 | ||
59 | error: slow zero-filling initialization | |
add651ee | 60 | --> $DIR/slow_vector_initialization.rs:56:5 |
064997fb FG |
61 | | |
62 | LL | let mut vec4 = Vec::with_capacity(len); | |
add651ee | 63 | | ----------------------- help: consider replacing this with: `vec![0; len]` |
064997fb FG |
64 | LL | vec4.resize(vec4.capacity(), 0); |
65 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
66 | ||
67 | error: slow zero-filling initialization | |
add651ee | 68 | --> $DIR/slow_vector_initialization.rs:60:5 |
f20569fa XL |
69 | | |
70 | LL | vec1 = Vec::with_capacity(10); | |
add651ee | 71 | | ---------------------- help: consider replacing this with: `vec![0; 10]` |
f20569fa XL |
72 | LL | vec1.resize(10, 0); |
73 | | ^^^^^^^^^^^^^^^^^^ | |
74 | ||
add651ee FG |
75 | error: slow zero-filling initialization |
76 | --> $DIR/slow_vector_initialization.rs:67:5 | |
77 | | | |
78 | LL | let mut vec1 = Vec::new(); | |
79 | | ---------- help: consider replacing this with: `vec![0; len]` | |
80 | LL | vec1.resize(len, 0); | |
81 | | ^^^^^^^^^^^^^^^^^^^ | |
82 | ||
83 | error: slow zero-filling initialization | |
84 | --> $DIR/slow_vector_initialization.rs:71:5 | |
85 | | | |
86 | LL | let mut vec3 = Vec::new(); | |
87 | | ---------- help: consider replacing this with: `vec![0; len - 10]` | |
88 | LL | vec3.resize(len - 10, 0); | |
89 | | ^^^^^^^^^^^^^^^^^^^^^^^^ | |
90 | ||
91 | error: slow zero-filling initialization | |
92 | --> $DIR/slow_vector_initialization.rs:75:5 | |
93 | | | |
94 | LL | vec1 = Vec::new(); | |
95 | | ---------- help: consider replacing this with: `vec![0; 10]` | |
96 | LL | vec1.resize(10, 0); | |
97 | | ^^^^^^^^^^^^^^^^^^ | |
98 | ||
99 | error: aborting due to 12 previous errors | |
f20569fa | 100 |