Fix article in test

This commit is contained in:
Zachary S 2024-05-15 13:15:59 -05:00
parent 66573b70a9
commit 6b818ddac6
2 changed files with 4 additions and 4 deletions

View File

@ -45,7 +45,7 @@ fn _returns_result() -> Result<(), ()> {
fn _by_ref() { fn _by_ref() {
// Shared refs // Shared refs
for _ in &Some(1) {} for _ in &Some(1) {}
//~^ WARN for loop over an `&Option`. This is more readably written as an `if let` statement //~^ WARN for loop over a `&Option`. This is more readably written as an `if let` statement
//~| HELP to check pattern in a loop use `while let` //~| HELP to check pattern in a loop use `while let`
//~| HELP consider using `if let` to clear intent //~| HELP consider using `if let` to clear intent
for _ in &Ok::<_, ()>(1) {} for _ in &Ok::<_, ()>(1) {}
@ -55,7 +55,7 @@ fn _by_ref() {
// Mutable refs // Mutable refs
for _ in &mut Some(1) {} for _ in &mut Some(1) {}
//~^ WARN for loop over an `&mut Option`. This is more readably written as an `if let` statement //~^ WARN for loop over a `&mut Option`. This is more readably written as an `if let` statement
//~| HELP to check pattern in a loop use `while let` //~| HELP to check pattern in a loop use `while let`
//~| HELP consider using `if let` to clear intent //~| HELP consider using `if let` to clear intent
for _ in &mut Ok::<_, ()>(1) {} for _ in &mut Ok::<_, ()>(1) {}

View File

@ -97,7 +97,7 @@ help: consider using `if let` to clear intent
LL | if let Ok(_) = Ok::<_, ()>([0; 0]) {} LL | if let Ok(_) = Ok::<_, ()>([0; 0]) {}
| ~~~~~~~~~~ ~~~ | ~~~~~~~~~~ ~~~
warning: for loop over an `&Option`. This is more readably written as an `if let` statement warning: for loop over a `&Option`. This is more readably written as an `if let` statement
--> $DIR/for_loop_over_fallibles.rs:47:14 --> $DIR/for_loop_over_fallibles.rs:47:14
| |
LL | for _ in &Some(1) {} LL | for _ in &Some(1) {}
@ -127,7 +127,7 @@ help: consider using `if let` to clear intent
LL | if let Ok(_) = &Ok::<_, ()>(1) {} LL | if let Ok(_) = &Ok::<_, ()>(1) {}
| ~~~~~~~~~~ ~~~ | ~~~~~~~~~~ ~~~
warning: for loop over an `&mut Option`. This is more readably written as an `if let` statement warning: for loop over a `&mut Option`. This is more readably written as an `if let` statement
--> $DIR/for_loop_over_fallibles.rs:57:14 --> $DIR/for_loop_over_fallibles.rs:57:14
| |
LL | for _ in &mut Some(1) {} LL | for _ in &mut Some(1) {}