1 error: for loop over `option`, which is an `Option`. This is more readably written as an `if let` statement.
2 --> $DIR/for_loop.rs:27:14
7 = note: `-D clippy::for-loop-over-option` implied by `-D warnings`
8 = help: consider replacing `for x in option` with `if let Some(x) = option`
10 error: for loop over `result`, which is a `Result`. This is more readably written as an `if let` statement.
11 --> $DIR/for_loop.rs:32:14
13 32 | for x in result {
16 = note: `-D clippy::for-loop-over-result` implied by `-D warnings`
17 = help: consider replacing `for x in result` with `if let Ok(x) = result`
19 error: for loop over `option.ok_or("x not found")`, which is a `Result`. This is more readably written as an `if let` statement.
20 --> $DIR/for_loop.rs:36:14
22 36 | for x in option.ok_or("x not found") {
23 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
25 = help: consider replacing `for x in option.ok_or("x not found")` with `if let Ok(x) = option.ok_or("x not found")`
27 error: you are iterating over `Iterator::next()` which is an Option; this will compile but is probably not what you want
28 --> $DIR/for_loop.rs:42:14
30 42 | for x in v.iter().next() {
33 = note: `-D clippy::iter-next-loop` implied by `-D warnings`
35 error: for loop over `v.iter().next().and(Some(0))`, which is an `Option`. This is more readably written as an `if let` statement.
36 --> $DIR/for_loop.rs:47:14
38 47 | for x in v.iter().next().and(Some(0)) {
39 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
41 = help: consider replacing `for x in v.iter().next().and(Some(0))` with `if let Some(x) = v.iter().next().and(Some(0))`
43 error: for loop over `v.iter().next().ok_or("x not found")`, which is a `Result`. This is more readably written as an `if let` statement.
44 --> $DIR/for_loop.rs:51:14
46 51 | for x in v.iter().next().ok_or("x not found") {
47 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
49 = help: consider replacing `for x in v.iter().next().ok_or("x not found")` with `if let Ok(x) = v.iter().next().ok_or("x not found")`
51 error: this loop never actually loops
52 --> $DIR/for_loop.rs:63:5
54 63 | / while let Some(x) = option {
55 64 | | println!("{}", x);
60 = note: `-D clippy::never-loop` implied by `-D warnings`
62 error: this loop never actually loops
63 --> $DIR/for_loop.rs:69:5
65 69 | / while let Ok(x) = result {
66 70 | | println!("{}", x);
71 error: the loop variable `i` is only used to index `vec`.
72 --> $DIR/for_loop.rs:96:14
74 96 | for i in 0..vec.len() {
77 = note: `-D clippy::needless-range-loop` implied by `-D warnings`
78 help: consider using an iterator
80 96 | for <item> in &vec {
83 error: the loop variable `i` is only used to index `vec`.
84 --> $DIR/for_loop.rs:105:14
86 105 | for i in 0..vec.len() {
88 help: consider using an iterator
90 105 | for <item> in &vec {
93 error: the loop variable `j` is only used to index `STATIC`.
94 --> $DIR/for_loop.rs:110:14
98 help: consider using an iterator
100 110 | for <item> in &STATIC {
103 error: the loop variable `j` is only used to index `CONST`.
104 --> $DIR/for_loop.rs:114:14
106 114 | for j in 0..4 {
108 help: consider using an iterator
110 114 | for <item> in &CONST {
113 error: the loop variable `i` is used to index `vec`
114 --> $DIR/for_loop.rs:118:14
116 118 | for i in 0..vec.len() {
118 help: consider using an iterator
120 118 | for (i, <item>) in vec.iter().enumerate() {
121 | ^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^
123 error: the loop variable `i` is only used to index `vec2`.
124 --> $DIR/for_loop.rs:126:14
126 126 | for i in 0..vec.len() {
128 help: consider using an iterator
130 126 | for <item> in vec2.iter().take(vec.len()) {
131 | ^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^
133 error: the loop variable `i` is only used to index `vec`.
134 --> $DIR/for_loop.rs:130:14
136 130 | for i in 5..vec.len() {
138 help: consider using an iterator
140 130 | for <item> in vec.iter().skip(5) {
141 | ^^^^^^ ^^^^^^^^^^^^^^^^^^
143 error: the loop variable `i` is only used to index `vec`.
144 --> $DIR/for_loop.rs:134:14
146 134 | for i in 0..MAX_LEN {
148 help: consider using an iterator
150 134 | for <item> in vec.iter().take(MAX_LEN) {
151 | ^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^
153 error: the loop variable `i` is only used to index `vec`.
154 --> $DIR/for_loop.rs:138:14
156 138 | for i in 0..=MAX_LEN {
158 help: consider using an iterator
160 138 | for <item> in vec.iter().take(MAX_LEN + 1) {
161 | ^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
163 error: the loop variable `i` is only used to index `vec`.
164 --> $DIR/for_loop.rs:142:14
166 142 | for i in 5..10 {
168 help: consider using an iterator
170 142 | for <item> in vec.iter().take(10).skip(5) {
171 | ^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^
173 error: the loop variable `i` is only used to index `vec`.
174 --> $DIR/for_loop.rs:146:14
176 146 | for i in 5..=10 {
178 help: consider using an iterator
180 146 | for <item> in vec.iter().take(10 + 1).skip(5) {
181 | ^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
183 error: the loop variable `i` is used to index `vec`
184 --> $DIR/for_loop.rs:150:14
186 150 | for i in 5..vec.len() {
188 help: consider using an iterator
190 150 | for (i, <item>) in vec.iter().enumerate().skip(5) {
191 | ^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
193 error: the loop variable `i` is used to index `vec`
194 --> $DIR/for_loop.rs:154:14
196 154 | for i in 5..10 {
198 help: consider using an iterator
200 154 | for (i, <item>) in vec.iter().enumerate().take(10).skip(5) {
201 | ^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
203 error: this range is empty so this for loop will never run
204 --> $DIR/for_loop.rs:158:14
206 158 | for i in 10..0 {
209 = note: `-D clippy::reverse-range-loop` implied by `-D warnings`
210 help: consider using the following if you are attempting to iterate over this range in reverse
212 158 | for i in (0..10).rev() {
215 error: this range is empty so this for loop will never run
216 --> $DIR/for_loop.rs:162:14
218 162 | for i in 10..=0 {
220 help: consider using the following if you are attempting to iterate over this range in reverse
222 162 | for i in (0...10).rev() {
225 error: this range is empty so this for loop will never run
226 --> $DIR/for_loop.rs:166:14
228 166 | for i in MAX_LEN..0 {
230 help: consider using the following if you are attempting to iterate over this range in reverse
232 166 | for i in (0..MAX_LEN).rev() {
235 error: this range is empty so this for loop will never run
236 --> $DIR/for_loop.rs:170:14
238 170 | for i in 5..5 {
241 error: this range is empty so this for loop will never run
242 --> $DIR/for_loop.rs:195:14
244 195 | for i in 10..5 + 4 {
246 help: consider using the following if you are attempting to iterate over this range in reverse
248 195 | for i in (5 + 4..10).rev() {
251 error: this range is empty so this for loop will never run
252 --> $DIR/for_loop.rs:199:14
254 199 | for i in (5 + 2)..(3 - 1) {
256 help: consider using the following if you are attempting to iterate over this range in reverse
258 199 | for i in ((3 - 1)..(5 + 2)).rev() {
259 | ^^^^^^^^^^^^^^^^^^^^^^^^
261 error: this range is empty so this for loop will never run
262 --> $DIR/for_loop.rs:203:14
264 203 | for i in (5 + 2)..(8 - 1) {
267 error: it is more concise to loop over references to containers instead of using explicit iteration methods
268 --> $DIR/for_loop.rs:225:15
270 225 | for _v in vec.iter() {}
271 | ^^^^^^^^^^ help: to write this more concisely, try: `&vec`
273 = note: `-D clippy::explicit-iter-loop` implied by `-D warnings`
275 error: it is more concise to loop over references to containers instead of using explicit iteration methods
276 --> $DIR/for_loop.rs:227:15
278 227 | for _v in vec.iter_mut() {}
279 | ^^^^^^^^^^^^^^ help: to write this more concisely, try: `&mut vec`
281 error: it is more concise to loop over containers instead of using explicit iteration methods`
282 --> $DIR/for_loop.rs:230:15
284 230 | for _v in out_vec.into_iter() {}
285 | ^^^^^^^^^^^^^^^^^^^ help: to write this more concisely, try: `out_vec`
287 = note: `-D clippy::explicit-into-iter-loop` implied by `-D warnings`
289 error: it is more concise to loop over references to containers instead of using explicit iteration methods
290 --> $DIR/for_loop.rs:233:15
292 233 | for _v in array.into_iter() {}
293 | ^^^^^^^^^^^^^^^^^ help: to write this more concisely, try: `&array`
295 error: it is more concise to loop over references to containers instead of using explicit iteration methods
296 --> $DIR/for_loop.rs:238:15
298 238 | for _v in [1, 2, 3].iter() {}
299 | ^^^^^^^^^^^^^^^^ help: to write this more concisely, try: `&[1, 2, 3]`
301 error: it is more concise to loop over references to containers instead of using explicit iteration methods
302 --> $DIR/for_loop.rs:242:15
304 242 | for _v in [0; 32].iter() {}
305 | ^^^^^^^^^^^^^^ help: to write this more concisely, try: `&[0; 32]`
307 error: it is more concise to loop over references to containers instead of using explicit iteration methods
308 --> $DIR/for_loop.rs:247:15
310 247 | for _v in ll.iter() {}
311 | ^^^^^^^^^ help: to write this more concisely, try: `&ll`
313 error: it is more concise to loop over references to containers instead of using explicit iteration methods
314 --> $DIR/for_loop.rs:250:15
316 250 | for _v in vd.iter() {}
317 | ^^^^^^^^^ help: to write this more concisely, try: `&vd`
319 error: it is more concise to loop over references to containers instead of using explicit iteration methods
320 --> $DIR/for_loop.rs:253:15
322 253 | for _v in bh.iter() {}
323 | ^^^^^^^^^ help: to write this more concisely, try: `&bh`
325 error: it is more concise to loop over references to containers instead of using explicit iteration methods
326 --> $DIR/for_loop.rs:256:15
328 256 | for _v in hm.iter() {}
329 | ^^^^^^^^^ help: to write this more concisely, try: `&hm`
331 error: it is more concise to loop over references to containers instead of using explicit iteration methods
332 --> $DIR/for_loop.rs:259:15
334 259 | for _v in bt.iter() {}
335 | ^^^^^^^^^ help: to write this more concisely, try: `&bt`
337 error: it is more concise to loop over references to containers instead of using explicit iteration methods
338 --> $DIR/for_loop.rs:262:15
340 262 | for _v in hs.iter() {}
341 | ^^^^^^^^^ help: to write this more concisely, try: `&hs`
343 error: it is more concise to loop over references to containers instead of using explicit iteration methods
344 --> $DIR/for_loop.rs:265:15
346 265 | for _v in bs.iter() {}
347 | ^^^^^^^^^ help: to write this more concisely, try: `&bs`
349 error: you are iterating over `Iterator::next()` which is an Option; this will compile but is probably not what you want
350 --> $DIR/for_loop.rs:267:15
352 267 | for _v in vec.iter().next() {}
355 error: you are collect()ing an iterator and throwing away the result. Consider using an explicit for loop to exhaust the iterator
356 --> $DIR/for_loop.rs:274:5
358 274 | vec.iter().cloned().map(|x| out.push(x)).collect::<Vec<_>>();
359 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
361 = note: `-D clippy::unused-collect` implied by `-D warnings`
363 error: you seem to want to iterate on a map's values
364 --> $DIR/for_loop.rs:385:19
366 385 | for (_, v) in &m {
369 = note: `-D clippy::for-kv-map` implied by `-D warnings`
370 help: use the corresponding method
372 385 | for v in m.values() {
375 error: you seem to want to iterate on a map's values
376 --> $DIR/for_loop.rs:390:19
378 390 | for (_, v) in &*m {
380 help: use the corresponding method
382 390 | for v in (*m).values() {
385 error: you seem to want to iterate on a map's values
386 --> $DIR/for_loop.rs:398:19
388 398 | for (_, v) in &mut m {
390 help: use the corresponding method
392 398 | for v in m.values_mut() {
395 error: you seem to want to iterate on a map's values
396 --> $DIR/for_loop.rs:403:19
398 403 | for (_, v) in &mut *m {
400 help: use the corresponding method
402 403 | for v in (*m).values_mut() {
403 | ^ ^^^^^^^^^^^^^^^^^
405 error: you seem to want to iterate on a map's keys
406 --> $DIR/for_loop.rs:409:24
408 409 | for (k, _value) in rm {
410 help: use the corresponding method
412 409 | for k in rm.keys() {
415 error: it looks like you're manually copying between slices
416 --> $DIR/for_loop.rs:462:14
418 462 | for i in 0..src.len() {
419 | ^^^^^^^^^^^^ help: try replacing the loop by: `dst[..src.len()].clone_from_slice(&src[..])`
421 = note: `-D clippy::manual-memcpy` implied by `-D warnings`
423 error: it looks like you're manually copying between slices
424 --> $DIR/for_loop.rs:467:14
426 467 | for i in 0..src.len() {
427 | ^^^^^^^^^^^^ help: try replacing the loop by: `dst[10..(src.len() + 10)].clone_from_slice(&src[..])`
429 error: it looks like you're manually copying between slices
430 --> $DIR/for_loop.rs:472:14
432 472 | for i in 0..src.len() {
433 | ^^^^^^^^^^^^ help: try replacing the loop by: `dst[..src.len()].clone_from_slice(&src[10..])`
435 error: it looks like you're manually copying between slices
436 --> $DIR/for_loop.rs:477:14
438 477 | for i in 11..src.len() {
439 | ^^^^^^^^^^^^^ help: try replacing the loop by: `dst[11..src.len()].clone_from_slice(&src[(11 - 10)..(src.len() - 10)])`
441 error: it looks like you're manually copying between slices
442 --> $DIR/for_loop.rs:482:14
444 482 | for i in 0..dst.len() {
445 | ^^^^^^^^^^^^ help: try replacing the loop by: `dst.clone_from_slice(&src[..dst.len()])`
447 error: it looks like you're manually copying between slices
448 --> $DIR/for_loop.rs:495:14
450 495 | for i in 10..256 {
452 help: try replacing the loop by
454 495 | for i in dst[10..256].clone_from_slice(&src[(10 - 5)..(256 - 5)])
455 496 | dst2[(10 + 500)..(256 + 500)].clone_from_slice(&src[10..256]) {
458 error: it looks like you're manually copying between slices
459 --> $DIR/for_loop.rs:507:14
461 507 | for i in 10..LOOP_OFFSET {
462 | ^^^^^^^^^^^^^^^ 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)])`
464 error: it looks like you're manually copying between slices
465 --> $DIR/for_loop.rs:520:14
467 520 | for i in 0..src_vec.len() {
468 | ^^^^^^^^^^^^^^^^ help: try replacing the loop by: `dst_vec[..src_vec.len()].clone_from_slice(&src_vec[..])`
470 error: it looks like you're manually copying between slices
471 --> $DIR/for_loop.rs:549:14
473 549 | for i in from..from + src.len() {
474 | ^^^^^^^^^^^^^^^^^^^^^^ help: try replacing the loop by: `dst[from..from + src.len()].clone_from_slice(&src[0..(from + src.len() - from)])`
476 error: it looks like you're manually copying between slices
477 --> $DIR/for_loop.rs:553:14
479 553 | for i in from..from + 3 {
480 | ^^^^^^^^^^^^^^ help: try replacing the loop by: `dst[from..from + 3].clone_from_slice(&src[0..(from + 3 - from)])`
482 error: it looks like you're manually copying between slices
483 --> $DIR/for_loop.rs:560:14
485 560 | for i in 0..src.len() {
486 | ^^^^^^^^^^^^ help: try replacing the loop by: `dst[..src.len()].clone_from_slice(&src[..])`
488 error: aborting due to 59 previous errors