]>
Commit | Line | Data |
---|---|---|
94222f64 | 1 | error: this `match` can be collapsed into the outer `match` |
cdc7bbd5 | 2 | --> $DIR/collapsible_match2.rs:13:34 |
f20569fa XL |
3 | | |
4 | LL | Ok(val) if make() => match val { | |
5 | | __________________________________^ | |
6 | LL | | Some(n) => foo(n), | |
7 | LL | | _ => return, | |
8 | LL | | }, | |
9 | | |_____________^ | |
10 | | | |
11 | = note: `-D clippy::collapsible-match` implied by `-D warnings` | |
12 | help: the outer pattern can be modified to include the inner pattern | |
cdc7bbd5 | 13 | --> $DIR/collapsible_match2.rs:13:16 |
f20569fa XL |
14 | | |
15 | LL | Ok(val) if make() => match val { | |
16 | | ^^^ replace this binding | |
17 | LL | Some(n) => foo(n), | |
18 | | ^^^^^^^ with this pattern | |
19 | ||
94222f64 | 20 | error: this `match` can be collapsed into the outer `match` |
cdc7bbd5 | 21 | --> $DIR/collapsible_match2.rs:20:24 |
f20569fa XL |
22 | | |
23 | LL | Ok(val) => match val { | |
24 | | ________________________^ | |
25 | LL | | Some(n) => foo(n), | |
26 | LL | | _ => return, | |
27 | LL | | }, | |
28 | | |_____________^ | |
29 | | | |
30 | help: the outer pattern can be modified to include the inner pattern | |
cdc7bbd5 | 31 | --> $DIR/collapsible_match2.rs:20:16 |
f20569fa XL |
32 | | |
33 | LL | Ok(val) => match val { | |
34 | | ^^^ replace this binding | |
35 | LL | Some(n) => foo(n), | |
36 | | ^^^^^^^ with this pattern | |
37 | ||
94222f64 | 38 | error: this `match` can be collapsed into the outer `match` |
cdc7bbd5 | 39 | --> $DIR/collapsible_match2.rs:34:29 |
f20569fa XL |
40 | | |
41 | LL | $pat => match $e { | |
42 | | _____________________________^ | |
43 | LL | | $inner_pat => $then, | |
44 | LL | | _ => return, | |
45 | LL | | }, | |
46 | | |_____________________^ | |
47 | ... | |
48 | LL | mac!(res_opt => Ok(val), val => Some(n), foo(n)); | |
49 | | ------------------------------------------------- in this macro invocation | |
50 | | | |
51 | help: the outer pattern can be modified to include the inner pattern | |
cdc7bbd5 | 52 | --> $DIR/collapsible_match2.rs:46:28 |
f20569fa XL |
53 | | |
54 | LL | mac!(res_opt => Ok(val), val => Some(n), foo(n)); | |
55 | | ^^^ ^^^^^^^ with this pattern | |
56 | | | | |
57 | | replace this binding | |
17df50a5 | 58 | = note: this error originates in the macro `mac` (in Nightly builds, run with -Z macro-backtrace for more info) |
f20569fa | 59 | |
94222f64 | 60 | error: this `match` can be collapsed into the outer `match` |
cdc7bbd5 | 61 | --> $DIR/collapsible_match2.rs:51:20 |
f20569fa XL |
62 | | |
63 | LL | Some(s) => match *s { | |
64 | | ____________________^ | |
65 | LL | | [n] => foo(n), | |
66 | LL | | _ => (), | |
67 | LL | | }, | |
68 | | |_________^ | |
69 | | | |
70 | help: the outer pattern can be modified to include the inner pattern | |
cdc7bbd5 | 71 | --> $DIR/collapsible_match2.rs:51:14 |
f20569fa XL |
72 | | |
73 | LL | Some(s) => match *s { | |
74 | | ^ replace this binding | |
75 | LL | [n] => foo(n), | |
76 | | ^^^ with this pattern | |
77 | ||
94222f64 | 78 | error: this `match` can be collapsed into the outer `match` |
cdc7bbd5 | 79 | --> $DIR/collapsible_match2.rs:60:24 |
f20569fa XL |
80 | | |
81 | LL | Some(ref s) => match &*s { | |
82 | | ________________________^ | |
83 | LL | | [n] => foo(n), | |
84 | LL | | _ => (), | |
85 | LL | | }, | |
86 | | |_________^ | |
87 | | | |
88 | help: the outer pattern can be modified to include the inner pattern | |
cdc7bbd5 | 89 | --> $DIR/collapsible_match2.rs:60:14 |
f20569fa XL |
90 | | |
91 | LL | Some(ref s) => match &*s { | |
92 | | ^^^^^ replace this binding | |
93 | LL | [n] => foo(n), | |
94 | | ^^^ with this pattern | |
95 | ||
96 | error: aborting due to 5 previous errors | |
97 |