mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-27 15:11:30 +00:00
64 lines
1.6 KiB
Text
64 lines
1.6 KiB
Text
error: this loop could be written as a `while let` loop
|
|
--> $DIR/while_let_loop.rs:6:5
|
|
|
|
|
LL | / loop {
|
|
LL | |
|
|
LL | |
|
|
LL | | if let Some(_x) = y {
|
|
... |
|
|
LL | | }
|
|
LL | | }
|
|
| |_____^ help: try: `while let Some(_x) = y { .. }`
|
|
|
|
|
= note: `-D clippy::while-let-loop` implied by `-D warnings`
|
|
|
|
error: this loop could be written as a `while let` loop
|
|
--> $DIR/while_let_loop.rs:25:5
|
|
|
|
|
LL | / loop {
|
|
LL | |
|
|
LL | | match y {
|
|
LL | | Some(_x) => true,
|
|
LL | | None => break,
|
|
LL | | };
|
|
LL | | }
|
|
| |_____^ help: try: `while let Some(_x) = y { .. }`
|
|
|
|
error: this loop could be written as a `while let` loop
|
|
--> $DIR/while_let_loop.rs:33:5
|
|
|
|
|
LL | / loop {
|
|
LL | |
|
|
LL | | let x = match y {
|
|
LL | | Some(x) => x,
|
|
... |
|
|
LL | | let _str = "foo";
|
|
LL | | }
|
|
| |_____^ help: try: `while let Some(x) = y { .. }`
|
|
|
|
error: this loop could be written as a `while let` loop
|
|
--> $DIR/while_let_loop.rs:43:5
|
|
|
|
|
LL | / loop {
|
|
LL | |
|
|
LL | | let x = match y {
|
|
LL | | Some(x) => x,
|
|
... |
|
|
LL | | }
|
|
LL | | }
|
|
| |_____^ help: try: `while let Some(x) = y { .. }`
|
|
|
|
error: this loop could be written as a `while let` loop
|
|
--> $DIR/while_let_loop.rs:74:5
|
|
|
|
|
LL | / loop {
|
|
LL | |
|
|
LL | | let (e, l) = match "".split_whitespace().next() {
|
|
LL | | Some(word) => (word.is_empty(), word.len()),
|
|
... |
|
|
LL | | let _ = (e, l);
|
|
LL | | }
|
|
| |_____^ help: try: `while let Some(word) = "".split_whitespace().next() { .. }`
|
|
|
|
error: aborting due to 5 previous errors
|
|
|