|
1 | 1 | error: it looks like you're manually copying between slices
|
2 |
| - --> $DIR/manual_memcpy.rs:7:14 |
| 2 | + --> $DIR/manual_memcpy.rs:7:5 |
3 | 3 | |
|
4 |
| -LL | for i in 0..src.len() { |
5 |
| - | ^^^^^^^^^^^^ help: try replacing the loop by: `dst[..src.len()].clone_from_slice(&src[..])` |
| 4 | +LL | / for i in 0..src.len() { |
| 5 | +LL | | dst[i] = src[i]; |
| 6 | +LL | | } |
| 7 | + | |_____^ help: try replacing the loop by: `dst[..src.len()].clone_from_slice(&src[..]);` |
6 | 8 | |
|
7 | 9 | = note: `-D clippy::manual-memcpy` implied by `-D warnings`
|
8 | 10 |
|
9 | 11 | error: it looks like you're manually copying between slices
|
10 |
| - --> $DIR/manual_memcpy.rs:12:14 |
| 12 | + --> $DIR/manual_memcpy.rs:12:5 |
11 | 13 | |
|
12 |
| -LL | for i in 0..src.len() { |
13 |
| - | ^^^^^^^^^^^^ help: try replacing the loop by: `dst[10..(src.len() + 10)].clone_from_slice(&src[..])` |
| 14 | +LL | / for i in 0..src.len() { |
| 15 | +LL | | dst[i + 10] = src[i]; |
| 16 | +LL | | } |
| 17 | + | |_____^ help: try replacing the loop by: `dst[10..(src.len() + 10)].clone_from_slice(&src[..]);` |
14 | 18 |
|
15 | 19 | error: it looks like you're manually copying between slices
|
16 |
| - --> $DIR/manual_memcpy.rs:17:14 |
| 20 | + --> $DIR/manual_memcpy.rs:17:5 |
17 | 21 | |
|
18 |
| -LL | for i in 0..src.len() { |
19 |
| - | ^^^^^^^^^^^^ help: try replacing the loop by: `dst[..src.len()].clone_from_slice(&src[10..(src.len() + 10)])` |
| 22 | +LL | / for i in 0..src.len() { |
| 23 | +LL | | dst[i] = src[i + 10]; |
| 24 | +LL | | } |
| 25 | + | |_____^ help: try replacing the loop by: `dst[..src.len()].clone_from_slice(&src[10..(src.len() + 10)]);` |
20 | 26 |
|
21 | 27 | error: it looks like you're manually copying between slices
|
22 |
| - --> $DIR/manual_memcpy.rs:22:14 |
| 28 | + --> $DIR/manual_memcpy.rs:22:5 |
23 | 29 | |
|
24 |
| -LL | for i in 11..src.len() { |
25 |
| - | ^^^^^^^^^^^^^ help: try replacing the loop by: `dst[11..src.len()].clone_from_slice(&src[(11 - 10)..(src.len() - 10)])` |
| 30 | +LL | / for i in 11..src.len() { |
| 31 | +LL | | dst[i] = src[i - 10]; |
| 32 | +LL | | } |
| 33 | + | |_____^ help: try replacing the loop by: `dst[11..src.len()].clone_from_slice(&src[(11 - 10)..(src.len() - 10)]);` |
26 | 34 |
|
27 | 35 | error: it looks like you're manually copying between slices
|
28 |
| - --> $DIR/manual_memcpy.rs:27:14 |
| 36 | + --> $DIR/manual_memcpy.rs:27:5 |
29 | 37 | |
|
30 |
| -LL | for i in 0..dst.len() { |
31 |
| - | ^^^^^^^^^^^^ help: try replacing the loop by: `dst.clone_from_slice(&src[..dst.len()])` |
| 38 | +LL | / for i in 0..dst.len() { |
| 39 | +LL | | dst[i] = src[i]; |
| 40 | +LL | | } |
| 41 | + | |_____^ help: try replacing the loop by: `dst.clone_from_slice(&src[..dst.len()]);` |
32 | 42 |
|
33 | 43 | error: it looks like you're manually copying between slices
|
34 |
| - --> $DIR/manual_memcpy.rs:40:14 |
| 44 | + --> $DIR/manual_memcpy.rs:40:5 |
35 | 45 | |
|
36 |
| -LL | for i in 10..256 { |
37 |
| - | ^^^^^^^ |
| 46 | +LL | / for i in 10..256 { |
| 47 | +LL | | dst[i] = src[i - 5]; |
| 48 | +LL | | dst2[i + 500] = src[i] |
| 49 | +LL | | } |
| 50 | + | |_____^ |
38 | 51 | |
|
39 | 52 | help: try replacing the loop by
|
40 | 53 | |
|
41 |
| -LL | for i in dst[10..256].clone_from_slice(&src[(10 - 5)..(256 - 5)]) |
42 |
| -LL | dst2[(10 + 500)..(256 + 500)].clone_from_slice(&src[10..256]) { |
| 54 | +LL | dst[10..256].clone_from_slice(&src[(10 - 5)..(256 - 5)]); |
| 55 | +LL | dst2[(10 + 500)..(256 + 500)].clone_from_slice(&src[10..256]); |
43 | 56 | |
|
44 | 57 |
|
45 | 58 | error: it looks like you're manually copying between slices
|
46 |
| - --> $DIR/manual_memcpy.rs:52:14 |
| 59 | + --> $DIR/manual_memcpy.rs:52:5 |
47 | 60 | |
|
48 |
| -LL | for i in 10..LOOP_OFFSET { |
49 |
| - | ^^^^^^^^^^^^^^^ help: try replacing the loop by: `dst[(10 + LOOP_OFFSET)..(LOOP_OFFSET + LOOP_OFFSET)].clone_from_slice(&src[(10 - some_var)..(LOOP_OFFSET - some_var)])` |
| 61 | +LL | / for i in 10..LOOP_OFFSET { |
| 62 | +LL | | dst[i + LOOP_OFFSET] = src[i - some_var]; |
| 63 | +LL | | } |
| 64 | + | |_____^ help: try replacing the loop by: `dst[(10 + LOOP_OFFSET)..(LOOP_OFFSET + LOOP_OFFSET)].clone_from_slice(&src[(10 - some_var)..(LOOP_OFFSET - some_var)]);` |
50 | 65 |
|
51 | 66 | error: it looks like you're manually copying between slices
|
52 |
| - --> $DIR/manual_memcpy.rs:65:14 |
| 67 | + --> $DIR/manual_memcpy.rs:65:5 |
53 | 68 | |
|
54 |
| -LL | for i in 0..src_vec.len() { |
55 |
| - | ^^^^^^^^^^^^^^^^ help: try replacing the loop by: `dst_vec[..src_vec.len()].clone_from_slice(&src_vec[..])` |
| 69 | +LL | / for i in 0..src_vec.len() { |
| 70 | +LL | | dst_vec[i] = src_vec[i]; |
| 71 | +LL | | } |
| 72 | + | |_____^ help: try replacing the loop by: `dst_vec[..src_vec.len()].clone_from_slice(&src_vec[..]);` |
56 | 73 |
|
57 | 74 | error: it looks like you're manually copying between slices
|
58 |
| - --> $DIR/manual_memcpy.rs:94:14 |
| 75 | + --> $DIR/manual_memcpy.rs:94:5 |
59 | 76 | |
|
60 |
| -LL | for i in from..from + src.len() { |
61 |
| - | ^^^^^^^^^^^^^^^^^^^^^^ help: try replacing the loop by: `dst[from..(from + src.len())].clone_from_slice(&src[..(from + src.len() - from)])` |
| 77 | +LL | / for i in from..from + src.len() { |
| 78 | +LL | | dst[i] = src[i - from]; |
| 79 | +LL | | } |
| 80 | + | |_____^ help: try replacing the loop by: `dst[from..(from + src.len())].clone_from_slice(&src[..(from + src.len() - from)]);` |
62 | 81 |
|
63 | 82 | error: it looks like you're manually copying between slices
|
64 |
| - --> $DIR/manual_memcpy.rs:98:14 |
| 83 | + --> $DIR/manual_memcpy.rs:98:5 |
65 | 84 | |
|
66 |
| -LL | for i in from..from + 3 { |
67 |
| - | ^^^^^^^^^^^^^^ help: try replacing the loop by: `dst[from..(from + 3)].clone_from_slice(&src[..(from + 3 - from)])` |
| 85 | +LL | / for i in from..from + 3 { |
| 86 | +LL | | dst[i] = src[i - from]; |
| 87 | +LL | | } |
| 88 | + | |_____^ help: try replacing the loop by: `dst[from..(from + 3)].clone_from_slice(&src[..(from + 3 - from)]);` |
68 | 89 |
|
69 | 90 | error: it looks like you're manually copying between slices
|
70 |
| - --> $DIR/manual_memcpy.rs:103:14 |
| 91 | + --> $DIR/manual_memcpy.rs:103:5 |
71 | 92 | |
|
72 |
| -LL | for i in 0..5 { |
73 |
| - | ^^^^ help: try replacing the loop by: `dst[..5].clone_from_slice(&src[..5])` |
| 93 | +LL | / for i in 0..5 { |
| 94 | +LL | | dst[i - 0] = src[i]; |
| 95 | +LL | | } |
| 96 | + | |_____^ help: try replacing the loop by: `dst[..5].clone_from_slice(&src[..5]);` |
74 | 97 |
|
75 | 98 | error: it looks like you're manually copying between slices
|
76 |
| - --> $DIR/manual_memcpy.rs:108:14 |
| 99 | + --> $DIR/manual_memcpy.rs:108:5 |
77 | 100 | |
|
78 |
| -LL | for i in 0..0 { |
79 |
| - | ^^^^ help: try replacing the loop by: `dst[..0].clone_from_slice(&src[..0])` |
| 101 | +LL | / for i in 0..0 { |
| 102 | +LL | | dst[i] = src[i]; |
| 103 | +LL | | } |
| 104 | + | |_____^ help: try replacing the loop by: `dst[..0].clone_from_slice(&src[..0]);` |
80 | 105 |
|
81 | 106 | error: it looks like you're manually copying between slices
|
82 |
| - --> $DIR/manual_memcpy.rs:120:14 |
| 107 | + --> $DIR/manual_memcpy.rs:120:5 |
83 | 108 | |
|
84 |
| -LL | for i in 3..src.len() { |
85 |
| - | ^^^^^^^^^^^^ help: try replacing the loop by: `dst[3..src.len()].clone_from_slice(&src[..(src.len() - 3)])` |
| 109 | +LL | / for i in 3..src.len() { |
| 110 | +LL | | dst[i] = src[count]; |
| 111 | +LL | | count += 1; |
| 112 | +LL | | } |
| 113 | + | |_____^ help: try replacing the loop by: `dst[3..src.len()].clone_from_slice(&src[..(src.len() - 3)]);` |
86 | 114 |
|
87 | 115 | error: it looks like you're manually copying between slices
|
88 |
| - --> $DIR/manual_memcpy.rs:126:14 |
| 116 | + --> $DIR/manual_memcpy.rs:126:5 |
89 | 117 | |
|
90 |
| -LL | for i in 3..src.len() { |
91 |
| - | ^^^^^^^^^^^^ help: try replacing the loop by: `dst[..(src.len() - 3)].clone_from_slice(&src[3..])` |
| 118 | +LL | / for i in 3..src.len() { |
| 119 | +LL | | dst[count] = src[i]; |
| 120 | +LL | | count += 1; |
| 121 | +LL | | } |
| 122 | + | |_____^ help: try replacing the loop by: `dst[..(src.len() - 3)].clone_from_slice(&src[3..]);` |
92 | 123 |
|
93 | 124 | error: it looks like you're manually copying between slices
|
94 |
| - --> $DIR/manual_memcpy.rs:132:14 |
| 125 | + --> $DIR/manual_memcpy.rs:132:5 |
95 | 126 | |
|
96 |
| -LL | for i in 0..src.len() { |
97 |
| - | ^^^^^^^^^^^^ help: try replacing the loop by: `dst[3..(src.len() + 3)].clone_from_slice(&src[..])` |
| 127 | +LL | / for i in 0..src.len() { |
| 128 | +LL | | dst[count] = src[i]; |
| 129 | +LL | | count += 1; |
| 130 | +LL | | } |
| 131 | + | |_____^ help: try replacing the loop by: `dst[3..(src.len() + 3)].clone_from_slice(&src[..]);` |
98 | 132 |
|
99 | 133 | error: it looks like you're manually copying between slices
|
100 |
| - --> $DIR/manual_memcpy.rs:138:14 |
| 134 | + --> $DIR/manual_memcpy.rs:138:5 |
101 | 135 | |
|
102 |
| -LL | for i in 0..src.len() { |
103 |
| - | ^^^^^^^^^^^^ help: try replacing the loop by: `dst[..src.len()].clone_from_slice(&src[3..(src.len() + 3)])` |
| 136 | +LL | / for i in 0..src.len() { |
| 137 | +LL | | dst[i] = src[count]; |
| 138 | +LL | | count += 1; |
| 139 | +LL | | } |
| 140 | + | |_____^ help: try replacing the loop by: `dst[..src.len()].clone_from_slice(&src[3..(src.len() + 3)]);` |
104 | 141 |
|
105 | 142 | error: it looks like you're manually copying between slices
|
106 |
| - --> $DIR/manual_memcpy.rs:144:14 |
| 143 | + --> $DIR/manual_memcpy.rs:144:5 |
107 | 144 | |
|
108 |
| -LL | for i in 3..(3 + src.len()) { |
109 |
| - | ^^^^^^^^^^^^^^^^^^ help: try replacing the loop by: `dst[3..((3 + src.len()))].clone_from_slice(&src[..((3 + src.len()) - 3)])` |
| 145 | +LL | / for i in 3..(3 + src.len()) { |
| 146 | +LL | | dst[i] = src[count]; |
| 147 | +LL | | count += 1; |
| 148 | +LL | | } |
| 149 | + | |_____^ help: try replacing the loop by: `dst[3..((3 + src.len()))].clone_from_slice(&src[..((3 + src.len()) - 3)]);` |
110 | 150 |
|
111 | 151 | error: it looks like you're manually copying between slices
|
112 |
| - --> $DIR/manual_memcpy.rs:150:14 |
| 152 | + --> $DIR/manual_memcpy.rs:150:5 |
113 | 153 | |
|
114 |
| -LL | for i in 5..src.len() { |
115 |
| - | ^^^^^^^^^^^^ help: try replacing the loop by: `dst[5..src.len()].clone_from_slice(&src[(3 - 2)..((src.len() - 2) + 3 - 5)])` |
| 154 | +LL | / for i in 5..src.len() { |
| 155 | +LL | | dst[i] = src[count - 2]; |
| 156 | +LL | | count += 1; |
| 157 | +LL | | } |
| 158 | + | |_____^ help: try replacing the loop by: `dst[5..src.len()].clone_from_slice(&src[(3 - 2)..((src.len() - 2) + 3 - 5)]);` |
116 | 159 |
|
117 | 160 | error: it looks like you're manually copying between slices
|
118 |
| - --> $DIR/manual_memcpy.rs:156:14 |
| 161 | + --> $DIR/manual_memcpy.rs:156:5 |
119 | 162 | |
|
120 |
| -LL | for i in 3..10 { |
121 |
| - | ^^^^^ help: try replacing the loop by: `dst[3..10].clone_from_slice(&src[5..(10 + 5 - 3)])` |
| 163 | +LL | / for i in 3..10 { |
| 164 | +LL | | dst[i] = src[count]; |
| 165 | +LL | | count += 1; |
| 166 | +LL | | } |
| 167 | + | |_____^ help: try replacing the loop by: `dst[3..10].clone_from_slice(&src[5..(10 + 5 - 3)]);` |
122 | 168 |
|
123 | 169 | error: it looks like you're manually copying between slices
|
124 |
| - --> $DIR/manual_memcpy.rs:163:14 |
| 170 | + --> $DIR/manual_memcpy.rs:163:5 |
125 | 171 | |
|
126 |
| -LL | for i in 0..src.len() { |
127 |
| - | ^^^^^^^^^^^^ |
| 172 | +LL | / for i in 0..src.len() { |
| 173 | +LL | | dst[count] = src[i]; |
| 174 | +LL | | dst2[count2] = src[i]; |
| 175 | +LL | | count += 1; |
| 176 | +LL | | count2 += 1; |
| 177 | +LL | | } |
| 178 | + | |_____^ |
128 | 179 | |
|
129 | 180 | help: try replacing the loop by
|
130 | 181 | |
|
131 |
| -LL | for i in dst[3..(src.len() + 3)].clone_from_slice(&src[..]) |
132 |
| -LL | dst2[30..(src.len() + 30)].clone_from_slice(&src[..]) { |
| 182 | +LL | dst[3..(src.len() + 3)].clone_from_slice(&src[..]); |
| 183 | +LL | dst2[30..(src.len() + 30)].clone_from_slice(&src[..]); |
133 | 184 | |
|
134 | 185 |
|
135 | 186 | error: it looks like you're manually copying between slices
|
136 |
| - --> $DIR/manual_memcpy.rs:173:14 |
| 187 | + --> $DIR/manual_memcpy.rs:173:5 |
137 | 188 | |
|
138 |
| -LL | for i in 0..1 << 1 { |
139 |
| - | ^^^^^^^^^ help: try replacing the loop by: `dst[(0 << 1)..((1 << 1) + (0 << 1))].clone_from_slice(&src[2..((1 << 1) + 2)])` |
| 189 | +LL | / for i in 0..1 << 1 { |
| 190 | +LL | | dst[count] = src[i + 2]; |
| 191 | +LL | | count += 1; |
| 192 | +LL | | } |
| 193 | + | |_____^ help: try replacing the loop by: `dst[(0 << 1)..((1 << 1) + (0 << 1))].clone_from_slice(&src[2..((1 << 1) + 2)]);` |
140 | 194 |
|
141 | 195 | error: it looks like you're manually copying between slices
|
142 |
| - --> $DIR/manual_memcpy.rs:181:14 |
| 196 | + --> $DIR/manual_memcpy.rs:181:5 |
143 | 197 | |
|
144 |
| -LL | for i in 0..src.len() { |
145 |
| - | ^^^^^^^^^^^^ help: try replacing the loop by: `dst[..src.len()].clone_from_slice(&src[..])` |
| 198 | +LL | / for i in 0..src.len() { |
| 199 | +LL | | dst[i] = src[i].clone(); |
| 200 | +LL | | } |
| 201 | + | |_____^ help: try replacing the loop by: `dst[..src.len()].clone_from_slice(&src[..]);` |
146 | 202 |
|
147 | 203 | error: aborting due to 22 previous errors
|
148 | 204 |
|
0 commit comments