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: the variable `_index` is used as a loop counter. Consider using `for (_index, item) in &vec.enumerate()` or similar iterators
364 --> $DIR/for_loop.rs:279:15
366 279 | for _v in &vec {
369 = note: `-D clippy::explicit-counter-loop` implied by `-D warnings`
371 error: the variable `_index` is used as a loop counter. Consider using `for (_index, item) in &vec.enumerate()` or similar iterators
372 --> $DIR/for_loop.rs:285:15
374 285 | for _v in &vec {
377 error: you seem to want to iterate on a map's values
378 --> $DIR/for_loop.rs:395:19
380 395 | for (_, v) in &m {
383 = note: `-D clippy::for-kv-map` implied by `-D warnings`
384 help: use the corresponding method
386 395 | for v in m.values() {
389 error: you seem to want to iterate on a map's values
390 --> $DIR/for_loop.rs:400:19
392 400 | for (_, v) in &*m {
394 help: use the corresponding method
396 400 | for v in (*m).values() {
399 error: you seem to want to iterate on a map's values
400 --> $DIR/for_loop.rs:408:19
402 408 | for (_, v) in &mut m {
404 help: use the corresponding method
406 408 | for v in m.values_mut() {
409 error: you seem to want to iterate on a map's values
410 --> $DIR/for_loop.rs:413:19
412 413 | for (_, v) in &mut *m {
414 help: use the corresponding method
416 413 | for v in (*m).values_mut() {
417 | ^ ^^^^^^^^^^^^^^^^^
419 error: you seem to want to iterate on a map's keys
420 --> $DIR/for_loop.rs:419:24
422 419 | for (k, _value) in rm {
424 help: use the corresponding method
426 419 | for k in rm.keys() {
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[..])`
435 = note: `-D clippy::manual-memcpy` implied by `-D warnings`
437 error: it looks like you're manually copying between slices
438 --> $DIR/for_loop.rs:477:14
440 477 | for i in 0..src.len() {
441 | ^^^^^^^^^^^^ help: try replacing the loop by: `dst[10..(src.len() + 10)].clone_from_slice(&src[..])`
443 error: it looks like you're manually copying between slices
444 --> $DIR/for_loop.rs:482:14
446 482 | for i in 0..src.len() {
447 | ^^^^^^^^^^^^ help: try replacing the loop by: `dst[..src.len()].clone_from_slice(&src[10..])`
449 error: it looks like you're manually copying between slices
450 --> $DIR/for_loop.rs:487:14
452 487 | for i in 11..src.len() {
453 | ^^^^^^^^^^^^^ help: try replacing the loop by: `dst[11..src.len()].clone_from_slice(&src[(11 - 10)..(src.len() - 10)])`
455 error: it looks like you're manually copying between slices
456 --> $DIR/for_loop.rs:492:14
458 492 | for i in 0..dst.len() {
459 | ^^^^^^^^^^^^ help: try replacing the loop by: `dst.clone_from_slice(&src[..dst.len()])`
461 error: it looks like you're manually copying between slices
462 --> $DIR/for_loop.rs:505:14
464 505 | for i in 10..256 {
466 help: try replacing the loop by
468 505 | for i in dst[10..256].clone_from_slice(&src[(10 - 5)..(256 - 5)])
469 506 | dst2[(10 + 500)..(256 + 500)].clone_from_slice(&src[10..256]) {
472 error: it looks like you're manually copying between slices
473 --> $DIR/for_loop.rs:517:14
475 517 | for i in 10..LOOP_OFFSET {
476 | ^^^^^^^^^^^^^^^ 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)])`
478 error: it looks like you're manually copying between slices
479 --> $DIR/for_loop.rs:530:14
481 530 | for i in 0..src_vec.len() {
482 | ^^^^^^^^^^^^^^^^ help: try replacing the loop by: `dst_vec[..src_vec.len()].clone_from_slice(&src_vec[..])`
484 error: it looks like you're manually copying between slices
485 --> $DIR/for_loop.rs:559:14
487 559 | for i in from..from + src.len() {
488 | ^^^^^^^^^^^^^^^^^^^^^^ help: try replacing the loop by: `dst[from..from + src.len()].clone_from_slice(&src[0..(from + src.len() - from)])`
490 error: it looks like you're manually copying between slices
491 --> $DIR/for_loop.rs:563:14
493 563 | for i in from..from + 3 {
494 | ^^^^^^^^^^^^^^ help: try replacing the loop by: `dst[from..from + 3].clone_from_slice(&src[0..(from + 3 - from)])`
496 error: it looks like you're manually copying between slices
497 --> $DIR/for_loop.rs:570:14
499 570 | for i in 0..src.len() {
500 | ^^^^^^^^^^^^ help: try replacing the loop by: `dst[..src.len()].clone_from_slice(&src[..])`
502 error: the variable `count` is used as a loop counter. Consider using `for (count, item) in text.chars().enumerate()` or similar iterators
503 --> $DIR/for_loop.rs:631:19
505 631 | for ch in text.chars() {
508 error: the variable `count` is used as a loop counter. Consider using `for (count, item) in text.chars().enumerate()` or similar iterators
509 --> $DIR/for_loop.rs:642:19
511 642 | for ch in text.chars() {
514 error: aborting due to 63 previous errors