2021-02-25 10:25:22 +00:00
|
|
|
error: unnecessary nested match
|
2020-12-06 14:01:03 +00:00
|
|
|
--> $DIR/collapsible_match.rs:7:20
|
|
|
|
|
|
|
|
|
LL | Ok(val) => match val {
|
|
|
|
| ____________________^
|
|
|
|
LL | | Some(n) => foo(n),
|
|
|
|
LL | | _ => return,
|
|
|
|
LL | | },
|
|
|
|
| |_________^
|
|
|
|
|
|
|
|
|
= note: `-D clippy::collapsible-match` implied by `-D warnings`
|
2021-02-25 10:25:22 +00:00
|
|
|
help: the outer pattern can be modified to include the inner pattern
|
2020-12-06 14:01:03 +00:00
|
|
|
--> $DIR/collapsible_match.rs:7:12
|
|
|
|
|
|
|
|
|
LL | Ok(val) => match val {
|
2021-02-25 10:25:22 +00:00
|
|
|
| ^^^ replace this binding
|
2020-12-06 14:01:03 +00:00
|
|
|
LL | Some(n) => foo(n),
|
|
|
|
| ^^^^^^^ with this pattern
|
|
|
|
|
2021-02-25 10:25:22 +00:00
|
|
|
error: unnecessary nested match
|
2020-12-06 14:01:03 +00:00
|
|
|
--> $DIR/collapsible_match.rs:16:20
|
|
|
|
|
|
|
|
|
LL | Ok(val) => match val {
|
|
|
|
| ____________________^
|
|
|
|
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
|
2020-12-06 14:01:03 +00:00
|
|
|
--> $DIR/collapsible_match.rs:16:12
|
|
|
|
|
|
|
|
|
LL | Ok(val) => match val {
|
2021-02-25 10:25:22 +00:00
|
|
|
| ^^^ replace this binding
|
2020-12-06 14:01:03 +00:00
|
|
|
LL | Some(n) => foo(n),
|
|
|
|
| ^^^^^^^ with this pattern
|
|
|
|
|
2021-02-25 10:25:22 +00:00
|
|
|
error: unnecessary nested match
|
2020-12-06 14:01:03 +00:00
|
|
|
--> $DIR/collapsible_match.rs:25:9
|
|
|
|
|
|
|
|
|
LL | / if let Some(n) = val {
|
|
|
|
LL | | take(n);
|
|
|
|
LL | | }
|
|
|
|
| |_________^
|
|
|
|
|
|
2021-02-25 10:25:22 +00:00
|
|
|
help: the outer pattern can be modified to include the inner pattern
|
2020-12-06 14:01:03 +00:00
|
|
|
--> $DIR/collapsible_match.rs:24:15
|
|
|
|
|
|
|
|
|
LL | if let Ok(val) = res_opt {
|
2021-02-25 10:25:22 +00:00
|
|
|
| ^^^ replace this binding
|
2020-12-06 14:01:03 +00:00
|
|
|
LL | if let Some(n) = val {
|
|
|
|
| ^^^^^^^ with this pattern
|
|
|
|
|
2021-02-25 10:25:22 +00:00
|
|
|
error: unnecessary nested match
|
2020-12-06 14:01:03 +00:00
|
|
|
--> $DIR/collapsible_match.rs:32:9
|
|
|
|
|
|
|
|
|
LL | / if let Some(n) = val {
|
|
|
|
LL | | take(n);
|
|
|
|
LL | | } else {
|
|
|
|
LL | | return;
|
|
|
|
LL | | }
|
|
|
|
| |_________^
|
|
|
|
|
|
2021-02-25 10:25:22 +00:00
|
|
|
help: the outer pattern can be modified to include the inner pattern
|
2020-12-06 14:01:03 +00:00
|
|
|
--> $DIR/collapsible_match.rs:31:15
|
|
|
|
|
|
|
|
|
LL | if let Ok(val) = res_opt {
|
2021-02-25 10:25:22 +00:00
|
|
|
| ^^^ replace this binding
|
2020-12-06 14:01:03 +00:00
|
|
|
LL | if let Some(n) = val {
|
|
|
|
| ^^^^^^^ with this pattern
|
|
|
|
|
2021-02-25 10:25:22 +00:00
|
|
|
error: unnecessary nested match
|
2020-12-06 14:01:03 +00:00
|
|
|
--> $DIR/collapsible_match.rs:43:9
|
|
|
|
|
|
|
|
|
LL | / match val {
|
|
|
|
LL | | Some(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
|
2020-12-06 14:01:03 +00:00
|
|
|
--> $DIR/collapsible_match.rs:42:15
|
|
|
|
|
|
|
|
|
LL | if let Ok(val) = res_opt {
|
2021-02-25 10:25:22 +00:00
|
|
|
| ^^^ replace this binding
|
2020-12-06 14:01:03 +00:00
|
|
|
LL | match val {
|
|
|
|
LL | Some(n) => foo(n),
|
|
|
|
| ^^^^^^^ with this pattern
|
|
|
|
|
2021-02-25 10:25:22 +00:00
|
|
|
error: unnecessary nested match
|
2020-12-06 14:01:03 +00:00
|
|
|
--> $DIR/collapsible_match.rs:52:13
|
|
|
|
|
|
|
|
|
LL | / if let Some(n) = val {
|
|
|
|
LL | | take(n);
|
|
|
|
LL | | }
|
|
|
|
| |_____________^
|
|
|
|
|
|
2021-02-25 10:25:22 +00:00
|
|
|
help: the outer pattern can be modified to include the inner pattern
|
2020-12-06 14:01:03 +00:00
|
|
|
--> $DIR/collapsible_match.rs:51:12
|
|
|
|
|
|
|
|
|
LL | Ok(val) => {
|
2021-02-25 10:25:22 +00:00
|
|
|
| ^^^ replace this binding
|
2020-12-06 14:01:03 +00:00
|
|
|
LL | if let Some(n) = val {
|
|
|
|
| ^^^^^^^ with this pattern
|
|
|
|
|
2021-02-25 10:25:22 +00:00
|
|
|
error: unnecessary nested match
|
2020-12-06 14:01:03 +00:00
|
|
|
--> $DIR/collapsible_match.rs:61:9
|
|
|
|
|
|
|
|
|
LL | / match val {
|
|
|
|
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
|
2020-12-06 14:01:03 +00:00
|
|
|
--> $DIR/collapsible_match.rs:60:15
|
|
|
|
|
|
|
|
|
LL | if let Ok(val) = res_opt {
|
2021-02-25 10:25:22 +00:00
|
|
|
| ^^^ replace this binding
|
2020-12-06 14:01:03 +00:00
|
|
|
LL | match val {
|
|
|
|
LL | Some(n) => foo(n),
|
|
|
|
| ^^^^^^^ with this pattern
|
|
|
|
|
2021-02-25 10:25:22 +00:00
|
|
|
error: unnecessary nested match
|
2020-12-06 14:01:03 +00:00
|
|
|
--> $DIR/collapsible_match.rs:72:13
|
|
|
|
|
|
|
|
|
LL | / if let Some(n) = val {
|
|
|
|
LL | | take(n);
|
|
|
|
LL | | } else {
|
|
|
|
LL | | return;
|
|
|
|
LL | | }
|
|
|
|
| |_____________^
|
|
|
|
|
|
2021-02-25 10:25:22 +00:00
|
|
|
help: the outer pattern can be modified to include the inner pattern
|
2020-12-06 14:01:03 +00:00
|
|
|
--> $DIR/collapsible_match.rs:71:12
|
|
|
|
|
|
|
|
|
LL | Ok(val) => {
|
2021-02-25 10:25:22 +00:00
|
|
|
| ^^^ replace this binding
|
2020-12-06 14:01:03 +00:00
|
|
|
LL | if let Some(n) = val {
|
|
|
|
| ^^^^^^^ with this pattern
|
|
|
|
|
2021-02-25 10:25:22 +00:00
|
|
|
error: unnecessary nested match
|
2020-12-06 14:01:03 +00:00
|
|
|
--> $DIR/collapsible_match.rs:83:20
|
|
|
|
|
|
|
|
|
LL | Ok(val) => match val {
|
|
|
|
| ____________________^
|
|
|
|
LL | | Some(n) => foo(n),
|
|
|
|
LL | | None => return,
|
|
|
|
LL | | },
|
|
|
|
| |_________^
|
|
|
|
|
|
2021-02-25 10:25:22 +00:00
|
|
|
help: the outer pattern can be modified to include the inner pattern
|
2020-12-06 14:01:03 +00:00
|
|
|
--> $DIR/collapsible_match.rs:83:12
|
|
|
|
|
|
|
|
|
LL | Ok(val) => match val {
|
2021-02-25 10:25:22 +00:00
|
|
|
| ^^^ replace this binding
|
2020-12-06 14:01:03 +00:00
|
|
|
LL | Some(n) => foo(n),
|
|
|
|
| ^^^^^^^ with this pattern
|
|
|
|
|
2021-02-25 10:25:22 +00:00
|
|
|
error: unnecessary nested match
|
2020-12-06 14:01:03 +00:00
|
|
|
--> $DIR/collapsible_match.rs:92:22
|
|
|
|
|
|
|
|
|
LL | Some(val) => match val {
|
|
|
|
| ______________________^
|
|
|
|
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
|
2020-12-06 14:01:03 +00:00
|
|
|
--> $DIR/collapsible_match.rs:92:14
|
|
|
|
|
|
|
|
|
LL | Some(val) => match val {
|
2021-02-25 10:25:22 +00:00
|
|
|
| ^^^ replace this binding
|
2020-12-06 14:01:03 +00:00
|
|
|
LL | Some(n) => foo(n),
|
|
|
|
| ^^^^^^^ with this pattern
|
|
|
|
|
|
|
|
error: aborting due to 10 previous errors
|
|
|
|
|