]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/tests/ui/while_let_loop.stderr
Rollup merge of #101118 - devnexen:fs_getmode_bsd, r=Mark-Simulacrum
[rust.git] / src / tools / clippy / tests / ui / while_let_loop.stderr
1 error: this loop could be written as a `while let` loop
2   --> $DIR/while_let_loop.rs:6:5
3    |
4 LL | /     loop {
5 LL | |         if let Some(_x) = y {
6 LL | |             let _v = 1;
7 LL | |         } else {
8 LL | |             break;
9 LL | |         }
10 LL | |     }
11    | |_____^ help: try: `while let Some(_x) = y { .. }`
12    |
13    = note: `-D clippy::while-let-loop` implied by `-D warnings`
14
15 error: this loop could be written as a `while let` loop
16   --> $DIR/while_let_loop.rs:23:5
17    |
18 LL | /     loop {
19 LL | |         match y {
20 LL | |             Some(_x) => true,
21 LL | |             None => break,
22 LL | |         };
23 LL | |     }
24    | |_____^ help: try: `while let Some(_x) = y { .. }`
25
26 error: this loop could be written as a `while let` loop
27   --> $DIR/while_let_loop.rs:30:5
28    |
29 LL | /     loop {
30 LL | |         let x = match y {
31 LL | |             Some(x) => x,
32 LL | |             None => break,
33 ...  |
34 LL | |         let _str = "foo";
35 LL | |     }
36    | |_____^ help: try: `while let Some(x) = y { .. }`
37
38 error: this loop could be written as a `while let` loop
39   --> $DIR/while_let_loop.rs:39:5
40    |
41 LL | /     loop {
42 LL | |         let x = match y {
43 LL | |             Some(x) => x,
44 LL | |             None => break,
45 ...  |
46 LL | |         }
47 LL | |     }
48    | |_____^ help: try: `while let Some(x) = y { .. }`
49
50 error: this loop could be written as a `while let` loop
51   --> $DIR/while_let_loop.rs:69:5
52    |
53 LL | /     loop {
54 LL | |         let (e, l) = match "".split_whitespace().next() {
55 LL | |             Some(word) => (word.is_empty(), word.len()),
56 LL | |             None => break,
57 ...  |
58 LL | |         let _ = (e, l);
59 LL | |     }
60    | |_____^ help: try: `while let Some(word) = "".split_whitespace().next() { .. }`
61
62 error: aborting due to 5 previous errors
63