1 error: for loop over `option`, which is an `Option`. This is more readably written as an `if let` statement.
2 --> $DIR/for_loop_over_option_result.rs:11: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_over_option_result.rs:16:14
13 LL | 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_over_option_result.rs:20:14
22 LL | 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_over_option_result.rs:26:14
30 LL | for x in v.iter().next() {
33 = note: `#[deny(clippy::iter_next_loop)]` on by default
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_over_option_result.rs:31:14
38 LL | 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_over_option_result.rs:35:14
46 LL | 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_over_option_result.rs:47:5
54 LL | / while let Some(x) = option {
55 LL | | println!("{}", x);
60 = note: `#[deny(clippy::never_loop)]` on by default
62 error: this loop never actually loops
63 --> $DIR/for_loop_over_option_result.rs:53:5
65 LL | / while let Ok(x) = result {
66 LL | | println!("{}", x);
71 error: aborting due to 8 previous errors