]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/tests/ui/needless_for_each_unfixable.stderr
Rollup merge of #84221 - ABouttefeux:generic-arg-elision, r=estebank
[rust.git] / src / tools / clippy / tests / ui / needless_for_each_unfixable.stderr
1 error: needless use of `for_each`
2   --> $DIR/needless_for_each_unfixable.rs:7:5
3    |
4 LL | /     v.iter().for_each(|v| {
5 LL | |         if *v == 10 {
6 LL | |             return;
7 LL | |         } else {
8 LL | |             println!("{}", v);
9 LL | |         }
10 LL | |     });
11    | |_______^
12    |
13    = note: `-D clippy::needless-for-each` implied by `-D warnings`
14 help: try
15    |
16 LL |     for v in v.iter() {
17 LL |         if *v == 10 {
18 LL |             return;
19 LL |         } else {
20 LL |             println!("{}", v);
21 LL |         }
22  ...
23 help: ...and replace `return` with `continue`
24    |
25 LL |             continue;
26    |             ^^^^^^^^
27
28 error: aborting due to previous error
29