Fix article in test
This commit is contained in:
parent
66573b70a9
commit
6b818ddac6
@ -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) {}
|
||||||
|
@ -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) {}
|
||||||
|
Loading…
Reference in New Issue
Block a user