summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/manual_let_else_match.stderr
blob: cd5e9a9ac39c0770fcd41351097e381cfe0f6ec4 (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
66
67
error: this could be rewritten as `let...else`
  --> $DIR/manual_let_else_match.rs:32:5
   |
LL | /     let v = match g() {
LL | |         Some(v_some) => v_some,
LL | |         None => return,
LL | |     };
   | |______^ help: consider writing: `let Some(v_some) = g() else { return };`
   |
   = note: `-D clippy::manual-let-else` implied by `-D warnings`

error: this could be rewritten as `let...else`
  --> $DIR/manual_let_else_match.rs:37:5
   |
LL | /     let v = match g() {
LL | |         Some(v_some) => v_some,
LL | |         _ => return,
LL | |     };
   | |______^ help: consider writing: `let Some(v_some) = g() else { return };`

error: this could be rewritten as `let...else`
  --> $DIR/manual_let_else_match.rs:44:9
   |
LL | /         let v = match h() {
LL | |             (Some(_), Some(_)) | (None, None) => continue,
LL | |             (Some(v), None) | (None, Some(v)) => v,
LL | |         };
   | |__________^ help: consider writing: `let ((Some(v), None) | (None, Some(v))) = h() else { continue };`

error: this could be rewritten as `let...else`
  --> $DIR/manual_let_else_match.rs:49:9
   |
LL | /         let v = match build_enum() {
LL | |             _ => continue,
LL | |             Variant::Bar(v) | Variant::Baz(v) => v,
LL | |         };
   | |__________^ help: consider writing: `let (Variant::Bar(v) | Variant::Baz(v)) = build_enum() else { continue };`

error: this could be rewritten as `let...else`
  --> $DIR/manual_let_else_match.rs:57:5
   |
LL | /     let v = match f() {
LL | |         Ok(v) => v,
LL | |         Err(_) => return,
LL | |     };
   | |______^ help: consider writing: `let Ok(v) = f() else { return };`

error: this could be rewritten as `let...else`
  --> $DIR/manual_let_else_match.rs:63:5
   |
LL | /     let v = match f().map_err(|_| ()) {
LL | |         Ok(v) => v,
LL | |         Err(()) => return,
LL | |     };
   | |______^ help: consider writing: `let Ok(v) = f().map_err(|_| ()) else { return };`

error: this could be rewritten as `let...else`
  --> $DIR/manual_let_else_match.rs:70:5
   |
LL | /     let _value = match f {
LL | |         Variant::Bar(_) | Variant::Baz(_) => (),
LL | |         _ => return,
LL | |     };
   | |______^ help: consider writing: `let (Variant::Bar(_) | Variant::Baz(_)) = f else { return };`

error: aborting due to 7 previous errors