11error: for loop over `option`, which is an `Option`. This is more readably written as an `if let` statement
2- --> $DIR/for_loops_over_fallibles.rs:9 :14
2+ --> $DIR/for_loops_over_fallibles.rs:10 :14
33 |
44LL | for x in option {
55 | ^^^^^^
@@ -8,71 +8,71 @@ LL | for x in option {
88 = help: consider replacing `for x in option` with `if let Some(x) = option`
99
1010error: for loop over `option`, which is an `Option`. This is more readably written as an `if let` statement
11- --> $DIR/for_loops_over_fallibles.rs:14 :14
11+ --> $DIR/for_loops_over_fallibles.rs:15 :14
1212 |
1313LL | for x in option.iter() {
1414 | ^^^^^^
1515 |
1616 = help: consider replacing `for x in option.iter()` with `if let Some(x) = option`
1717
1818error: for loop over `result`, which is a `Result`. This is more readably written as an `if let` statement
19- --> $DIR/for_loops_over_fallibles.rs:19 :14
19+ --> $DIR/for_loops_over_fallibles.rs:20 :14
2020 |
2121LL | for x in result {
2222 | ^^^^^^
2323 |
2424 = help: consider replacing `for x in result` with `if let Ok(x) = result`
2525
2626error: for loop over `result`, which is a `Result`. This is more readably written as an `if let` statement
27- --> $DIR/for_loops_over_fallibles.rs:24 :14
27+ --> $DIR/for_loops_over_fallibles.rs:25 :14
2828 |
2929LL | for x in result.iter_mut() {
3030 | ^^^^^^
3131 |
3232 = help: consider replacing `for x in result.iter_mut()` with `if let Ok(x) = result`
3333
3434error: for loop over `result`, which is a `Result`. This is more readably written as an `if let` statement
35- --> $DIR/for_loops_over_fallibles.rs:29 :14
35+ --> $DIR/for_loops_over_fallibles.rs:30 :14
3636 |
3737LL | for x in result.into_iter() {
3838 | ^^^^^^
3939 |
4040 = help: consider replacing `for x in result.into_iter()` with `if let Ok(x) = result`
4141
4242error: for loop over `option.ok_or("x not found")`, which is a `Result`. This is more readably written as an `if let` statement
43- --> $DIR/for_loops_over_fallibles.rs:33 :14
43+ --> $DIR/for_loops_over_fallibles.rs:34 :14
4444 |
4545LL | for x in option.ok_or("x not found") {
4646 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
4747 |
4848 = help: consider replacing `for x in option.ok_or("x not found")` with `if let Ok(x) = option.ok_or("x not found")`
4949
5050error: you are iterating over `Iterator::next()` which is an Option; this will compile but is probably not what you want
51- --> $DIR/for_loops_over_fallibles.rs:39 :14
51+ --> $DIR/for_loops_over_fallibles.rs:40 :14
5252 |
5353LL | for x in v.iter().next() {
5454 | ^^^^^^^^^^^^^^^
5555 |
5656 = note: `#[deny(clippy::iter_next_loop)]` on by default
5757
5858error: for loop over `v.iter().next().and(Some(0))`, which is an `Option`. This is more readably written as an `if let` statement
59- --> $DIR/for_loops_over_fallibles.rs:44 :14
59+ --> $DIR/for_loops_over_fallibles.rs:45 :14
6060 |
6161LL | for x in v.iter().next().and(Some(0)) {
6262 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6363 |
6464 = help: consider replacing `for x in v.iter().next().and(Some(0))` with `if let Some(x) = v.iter().next().and(Some(0))`
6565
6666error: 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
67- --> $DIR/for_loops_over_fallibles.rs:48 :14
67+ --> $DIR/for_loops_over_fallibles.rs:49 :14
6868 |
6969LL | for x in v.iter().next().ok_or("x not found") {
7070 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
7171 |
7272 = 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")`
7373
7474error: this loop never actually loops
75- --> $DIR/for_loops_over_fallibles.rs:60 :5
75+ --> $DIR/for_loops_over_fallibles.rs:61 :5
7676 |
7777LL | / while let Some(x) = option {
7878LL | | println!("{}", x);
@@ -83,7 +83,7 @@ LL | | }
8383 = note: `#[deny(clippy::never_loop)]` on by default
8484
8585error: this loop never actually loops
86- --> $DIR/for_loops_over_fallibles.rs:66 :5
86+ --> $DIR/for_loops_over_fallibles.rs:67 :5
8787 |
8888LL | / while let Ok(x) = result {
8989LL | | println!("{}", x);
0 commit comments