1 error: unnecessary nested match
2 --> $DIR/collapsible_match2.rs:8:34
4 LL | Ok(val) if make() => match val {
5 | __________________________________^
6 LL | | Some(n) => foo(n),
11 = note: `-D clippy::collapsible-match` implied by `-D warnings`
12 help: the outer pattern can be modified to include the inner pattern
13 --> $DIR/collapsible_match2.rs:8:16
15 LL | Ok(val) if make() => match val {
16 | ^^^ replace this binding
17 LL | Some(n) => foo(n),
18 | ^^^^^^^ with this pattern
20 error: unnecessary nested match
21 --> $DIR/collapsible_match2.rs:15:24
23 LL | Ok(val) => match val {
24 | ________________________^
25 LL | | Some(n) => foo(n),
30 help: the outer pattern can be modified to include the inner pattern
31 --> $DIR/collapsible_match2.rs:15:16
33 LL | Ok(val) => match val {
34 | ^^^ replace this binding
35 LL | Some(n) => foo(n),
36 | ^^^^^^^ with this pattern
38 error: unnecessary nested match
39 --> $DIR/collapsible_match2.rs:29:29
41 LL | $pat => match $e {
42 | _____________________________^
43 LL | | $inner_pat => $then,
46 | |_____________________^
48 LL | mac!(res_opt => Ok(val), val => Some(n), foo(n));
49 | ------------------------------------------------- in this macro invocation
51 help: the outer pattern can be modified to include the inner pattern
52 --> $DIR/collapsible_match2.rs:41:28
54 LL | mac!(res_opt => Ok(val), val => Some(n), foo(n));
55 | ^^^ ^^^^^^^ with this pattern
57 | replace this binding
58 = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
60 error: unnecessary nested match
61 --> $DIR/collapsible_match2.rs:46:20
63 LL | Some(s) => match *s {
64 | ____________________^
70 help: the outer pattern can be modified to include the inner pattern
71 --> $DIR/collapsible_match2.rs:46:14
73 LL | Some(s) => match *s {
74 | ^ replace this binding
76 | ^^^ with this pattern
78 error: unnecessary nested match
79 --> $DIR/collapsible_match2.rs:55:24
81 LL | Some(ref s) => match &*s {
82 | ________________________^
88 help: the outer pattern can be modified to include the inner pattern
89 --> $DIR/collapsible_match2.rs:55:14
91 LL | Some(ref s) => match &*s {
92 | ^^^^^ replace this binding
94 | ^^^ with this pattern
96 error: aborting due to 5 previous errors