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 `result`, which is a `Result`. This is more readably written as an `if let` statement
11 --> $DIR/for_loops_over_fallibles.rs:14:14
13 LL | for x in result {
16 = help: consider replacing `for x in result` with `if let Ok(x) = result`
18 error: for loop over `option.ok_or("x not found")`, which is a `Result`. This is more readably written as an `if let` statement
19 --> $DIR/for_loops_over_fallibles.rs:18:14
21 LL | for x in option.ok_or("x not found") {
22 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
24 = help: consider replacing `for x in option.ok_or("x not found")` with `if let Ok(x) = option.ok_or("x not found")`
26 error: you are iterating over `Iterator::next()` which is an Option; this will compile but is probably not what you want
27 --> $DIR/for_loops_over_fallibles.rs:24:14
29 LL | for x in v.iter().next() {
32 = note: `#[deny(clippy::iter_next_loop)]` on by default
34 error: for loop over `v.iter().next().and(Some(0))`, which is an `Option`. This is more readably written as an `if let` statement
35 --> $DIR/for_loops_over_fallibles.rs:29:14
37 LL | for x in v.iter().next().and(Some(0)) {
38 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
40 = help: consider replacing `for x in v.iter().next().and(Some(0))` with `if let Some(x) = v.iter().next().and(Some(0))`
42 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
43 --> $DIR/for_loops_over_fallibles.rs:33:14
45 LL | for x in v.iter().next().ok_or("x not found") {
46 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
48 = 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")`
50 error: this loop never actually loops
51 --> $DIR/for_loops_over_fallibles.rs:45:5
53 LL | / while let Some(x) = option {
54 LL | | println!("{}", x);
59 = note: `#[deny(clippy::never_loop)]` on by default
61 error: this loop never actually loops
62 --> $DIR/for_loops_over_fallibles.rs:51:5
64 LL | / while let Ok(x) = result {
65 LL | | println!("{}", x);
70 error: aborting due to 8 previous errors