1 error: 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
7 = note: `-D clippy::for-loops-over-fallibles` implied by `-D warnings`
8 = help: consider replacing `for x in option` with `if let Some(x) = option`
10 error: 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
13 LL | for x in option.iter() {
16 = help: consider replacing `for x in option.iter()` with `if let Some(x) = option`
18 error: 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
21 LL | for x in result {
24 = help: consider replacing `for x in result` with `if let Ok(x) = result`
26 error: 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
29 LL | for x in result.iter_mut() {
32 = help: consider replacing `for x in result.iter_mut()` with `if let Ok(x) = result`
34 error: 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
37 LL | for x in result.into_iter() {
40 = help: consider replacing `for x in result.into_iter()` with `if let Ok(x) = result`
42 error: 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
45 LL | for x in option.ok_or("x not found") {
46 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
48 = help: consider replacing `for x in option.ok_or("x not found")` with `if let Ok(x) = option.ok_or("x not found")`
50 error: 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
53 LL | for x in v.iter().next() {
56 = note: `#[deny(clippy::iter_next_loop)]` on by default
58 error: 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
61 LL | for x in v.iter().next().and(Some(0)) {
62 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
64 = help: consider replacing `for x in v.iter().next().and(Some(0))` with `if let Some(x) = v.iter().next().and(Some(0))`
66 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
67 --> $DIR/for_loops_over_fallibles.rs:48:14
69 LL | for x in v.iter().next().ok_or("x not found") {
70 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
72 = 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")`
74 error: this loop never actually loops
75 --> $DIR/for_loops_over_fallibles.rs:60:5
77 LL | / while let Some(x) = option {
78 LL | | println!("{}", x);
83 = note: `#[deny(clippy::never_loop)]` on by default
85 error: this loop never actually loops
86 --> $DIR/for_loops_over_fallibles.rs:66:5
88 LL | / while let Ok(x) = result {
89 LL | | println!("{}", x);
94 error: aborting due to 11 previous errors