Skip to content

Commit 3737abe

Browse files
committed
change based on review
1 parent 5a49918 commit 3737abe

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

tests/ui/for_loops_over_fallibles.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ fn for_loops_over_fallibles() {
2121
}
2222

2323
// check over a `Result`
24-
for x in result.into_iter() {
24+
for x in result.iter_mut() {
2525
println!("{}", x);
2626
}
2727

2828
// check over a `Result`
29-
for x in result.iter_mut() {
29+
for x in result.into_iter() {
3030
println!("{}", x);
3131
}
3232

tests/ui/for_loops_over_fallibles.stderr

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,18 @@ LL | for x in result {
2626
error: for loop over `result`, which is a `Result`. This is more readably written as an `if let` statement
2727
--> $DIR/for_loops_over_fallibles.rs:24:14
2828
|
29-
LL | for x in result.into_iter() {
29+
LL | for x in result.iter_mut() {
3030
| ^^^^^^
3131
|
32-
= help: consider replacing `for x in result.into_iter()` with `if let Ok(x) = result`
32+
= help: consider replacing `for x in result.iter_mut()` with `if let Ok(x) = result`
3333

3434
error: for loop over `result`, which is a `Result`. This is more readably written as an `if let` statement
3535
--> $DIR/for_loops_over_fallibles.rs:29:14
3636
|
37-
LL | for x in result.iter_mut() {
37+
LL | for x in result.into_iter() {
3838
| ^^^^^^
3939
|
40-
= help: consider replacing `for x in result.iter_mut()` with `if let Ok(x) = result`
40+
= help: consider replacing `for x in result.into_iter()` with `if let Ok(x) = result`
4141

4242
error: for loop over `option.ok_or("x not found")`, which is a `Result`. This is more readably written as an `if let` statement
4343
--> $DIR/for_loops_over_fallibles.rs:33:14

0 commit comments

Comments
 (0)