summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/while_let_loop.stderr
blob: db887dc65c6a2512be4fe98365f58068ce597372 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
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`
   = help: to override `-D warnings` add `#[allow(clippy::while_let_loop)]`

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