2021-08-19 18:31:25 +00:00
|
|
|
error: this `match` can be collapsed into the outer `match`
|
2021-04-08 15:50:13 +00:00
|
|
|
--> $DIR/collapsible_match2.rs:13:34
|
2020-12-06 14:01:03 +00:00
|
|
|
|
|
|
|
|
LL | Ok(val) if make() => match val {
|
|
|
|
| __________________________________^
|
2023-07-28 19:35:48 +00:00
|
|
|
LL | |
|
2020-12-06 14:01:03 +00:00
|
|
|
LL | | Some(n) => foo(n),
|
|
|
|
LL | | _ => return,
|
|
|
|
LL | | },
|
|
|
|
| |_____________^
|
|
|
|
|
|
2021-02-25 10:25:22 +00:00
|
|
|
help: the outer pattern can be modified to include the inner pattern
|
2021-04-08 15:50:13 +00:00
|
|
|
--> $DIR/collapsible_match2.rs:13:16
|
2020-12-06 14:01:03 +00:00
|
|
|
|
|
|
|
|
LL | Ok(val) if make() => match val {
|
2021-02-25 10:25:22 +00:00
|
|
|
| ^^^ replace this binding
|
2023-07-28 19:35:48 +00:00
|
|
|
LL |
|
2020-12-06 14:01:03 +00:00
|
|
|
LL | Some(n) => foo(n),
|
|
|
|
| ^^^^^^^ with this pattern
|
2022-09-22 16:04:22 +00:00
|
|
|
= note: `-D clippy::collapsible-match` implied by `-D warnings`
|
2020-12-06 14:01:03 +00:00
|
|
|
|
2021-08-19 18:31:25 +00:00
|
|
|
error: this `match` can be collapsed into the outer `match`
|
2023-07-28 19:35:48 +00:00
|
|
|
--> $DIR/collapsible_match2.rs:21:24
|
2020-12-06 14:01:03 +00:00
|
|
|
|
|
|
|
|
LL | Ok(val) => match val {
|
|
|
|
| ________________________^
|
2023-07-28 19:35:48 +00:00
|
|
|
LL | |
|
2020-12-06 14:01:03 +00:00
|
|
|
LL | | Some(n) => foo(n),
|
|
|
|
LL | | _ => return,
|
|
|
|
LL | | },
|
|
|
|
| |_____________^
|
|
|
|
|
|
2021-02-25 10:25:22 +00:00
|
|
|
help: the outer pattern can be modified to include the inner pattern
|
2023-07-28 19:35:48 +00:00
|
|
|
--> $DIR/collapsible_match2.rs:21:16
|
2020-12-06 14:01:03 +00:00
|
|
|
|
|
|
|
|
LL | Ok(val) => match val {
|
2021-02-25 10:25:22 +00:00
|
|
|
| ^^^ replace this binding
|
2023-07-28 19:35:48 +00:00
|
|
|
LL |
|
2020-12-06 14:01:03 +00:00
|
|
|
LL | Some(n) => foo(n),
|
|
|
|
| ^^^^^^^ with this pattern
|
|
|
|
|
2021-08-19 18:31:25 +00:00
|
|
|
error: this `match` can be collapsed into the outer `match`
|
2023-07-28 19:35:48 +00:00
|
|
|
--> $DIR/collapsible_match2.rs:36:29
|
2020-12-06 14:01:03 +00:00
|
|
|
|
|
|
|
|
LL | $pat => match $e {
|
|
|
|
| _____________________________^
|
|
|
|
LL | | $inner_pat => $then,
|
|
|
|
LL | | _ => return,
|
|
|
|
LL | | },
|
|
|
|
| |_____________________^
|
|
|
|
...
|
|
|
|
LL | mac!(res_opt => Ok(val), val => Some(n), foo(n));
|
2021-10-14 18:28:30 +00:00
|
|
|
| ------------------------------------------------ in this macro invocation
|
2020-12-06 14:01:03 +00:00
|
|
|
|
|
2021-02-25 10:25:22 +00:00
|
|
|
help: the outer pattern can be modified to include the inner pattern
|
2023-07-28 19:35:48 +00:00
|
|
|
--> $DIR/collapsible_match2.rs:48:28
|
2020-12-06 14:01:03 +00:00
|
|
|
|
|
|
|
|
LL | mac!(res_opt => Ok(val), val => Some(n), foo(n));
|
|
|
|
| ^^^ ^^^^^^^ with this pattern
|
|
|
|
| |
|
2021-02-25 10:25:22 +00:00
|
|
|
| replace this binding
|
2021-02-13 19:52:25 +00:00
|
|
|
= note: this error originates in the macro `mac` (in Nightly builds, run with -Z macro-backtrace for more info)
|
2020-12-06 14:01:03 +00:00
|
|
|
|
2021-08-19 18:31:25 +00:00
|
|
|
error: this `match` can be collapsed into the outer `match`
|
2023-07-28 19:35:48 +00:00
|
|
|
--> $DIR/collapsible_match2.rs:53:20
|
2021-01-30 17:06:34 +00:00
|
|
|
|
|
|
|
|
LL | Some(s) => match *s {
|
|
|
|
| ____________________^
|
2023-07-28 19:35:48 +00:00
|
|
|
LL | |
|
2021-01-30 17:06:34 +00:00
|
|
|
LL | | [n] => foo(n),
|
|
|
|
LL | | _ => (),
|
|
|
|
LL | | },
|
|
|
|
| |_________^
|
|
|
|
|
|
2021-02-25 10:25:22 +00:00
|
|
|
help: the outer pattern can be modified to include the inner pattern
|
2023-07-28 19:35:48 +00:00
|
|
|
--> $DIR/collapsible_match2.rs:53:14
|
2021-01-30 17:06:34 +00:00
|
|
|
|
|
|
|
|
LL | Some(s) => match *s {
|
2021-02-25 10:25:22 +00:00
|
|
|
| ^ replace this binding
|
2023-07-28 19:35:48 +00:00
|
|
|
LL |
|
2021-01-30 17:06:34 +00:00
|
|
|
LL | [n] => foo(n),
|
|
|
|
| ^^^ with this pattern
|
|
|
|
|
2021-08-19 18:31:25 +00:00
|
|
|
error: this `match` can be collapsed into the outer `match`
|
2023-07-28 19:35:48 +00:00
|
|
|
--> $DIR/collapsible_match2.rs:63:24
|
2021-01-30 17:06:34 +00:00
|
|
|
|
|
2022-06-04 11:34:07 +00:00
|
|
|
LL | Some(ref s) => match s {
|
2021-01-30 17:06:34 +00:00
|
|
|
| ________________________^
|
2023-07-28 19:35:48 +00:00
|
|
|
LL | |
|
2021-01-30 17:06:34 +00:00
|
|
|
LL | | [n] => foo(n),
|
|
|
|
LL | | _ => (),
|
|
|
|
LL | | },
|
|
|
|
| |_________^
|
|
|
|
|
|
2021-02-25 10:25:22 +00:00
|
|
|
help: the outer pattern can be modified to include the inner pattern
|
2023-07-28 19:35:48 +00:00
|
|
|
--> $DIR/collapsible_match2.rs:63:14
|
2021-01-30 17:06:34 +00:00
|
|
|
|
|
2022-06-04 11:34:07 +00:00
|
|
|
LL | Some(ref s) => match s {
|
2021-02-25 10:25:22 +00:00
|
|
|
| ^^^^^ replace this binding
|
2023-07-28 19:35:48 +00:00
|
|
|
LL |
|
2021-01-30 17:06:34 +00:00
|
|
|
LL | [n] => foo(n),
|
|
|
|
| ^^^ with this pattern
|
|
|
|
|
|
|
|
error: aborting due to 5 previous errors
|
2020-12-06 14:01:03 +00:00
|
|
|
|