2019-05-08 07:19:08 +00:00
|
|
|
error: this loop could be written as a `while let` loop
|
2024-02-27 14:25:18 +00:00
|
|
|
--> tests/ui/while_let_loop.rs:6:5
|
2019-05-08 07:19:08 +00:00
|
|
|
|
|
|
|
|
LL | / loop {
|
2023-08-24 19:32:12 +00:00
|
|
|
LL | |
|
|
|
|
LL | |
|
2019-05-08 07:19:08 +00:00
|
|
|
LL | | if let Some(_x) = y {
|
2023-08-24 19:32:12 +00:00
|
|
|
... |
|
2019-05-08 07:19:08 +00:00
|
|
|
LL | | }
|
|
|
|
LL | | }
|
|
|
|
| |_____^ help: try: `while let Some(_x) = y { .. }`
|
|
|
|
|
|
|
|
|
= note: `-D clippy::while-let-loop` implied by `-D warnings`
|
2023-08-01 12:02:21 +00:00
|
|
|
= help: to override `-D warnings` add `#[allow(clippy::while_let_loop)]`
|
2019-05-08 07:19:08 +00:00
|
|
|
|
|
|
|
error: this loop could be written as a `while let` loop
|
2024-02-27 14:25:18 +00:00
|
|
|
--> tests/ui/while_let_loop.rs:25:5
|
2019-05-08 07:19:08 +00:00
|
|
|
|
|
|
|
|
LL | / loop {
|
2023-08-24 19:32:12 +00:00
|
|
|
LL | |
|
2019-05-08 07:19:08 +00:00
|
|
|
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
|
2024-02-27 14:25:18 +00:00
|
|
|
--> tests/ui/while_let_loop.rs:33:5
|
2019-05-08 07:19:08 +00:00
|
|
|
|
|
|
|
|
LL | / loop {
|
2023-08-24 19:32:12 +00:00
|
|
|
LL | |
|
2019-05-08 07:19:08 +00:00
|
|
|
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
|
2024-02-27 14:25:18 +00:00
|
|
|
--> tests/ui/while_let_loop.rs:43:5
|
2019-05-08 07:19:08 +00:00
|
|
|
|
|
|
|
|
LL | / loop {
|
2023-08-24 19:32:12 +00:00
|
|
|
LL | |
|
2019-05-08 07:19:08 +00:00
|
|
|
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
|
2024-02-27 14:25:18 +00:00
|
|
|
--> tests/ui/while_let_loop.rs:74:5
|
2019-05-08 07:19:08 +00:00
|
|
|
|
|
|
|
|
LL | / loop {
|
2023-08-24 19:32:12 +00:00
|
|
|
LL | |
|
2019-05-08 07:19:08 +00:00
|
|
|
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
|
|
|
|
|