rust-clippy/tests/ui/collapsible_match.stderr

180 lines
5 KiB
Text
Raw Normal View History

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