rust/tests/ui/collapsible_match.stderr
2021-08-19 14:17:05 -05:00

180 lines
5.3 KiB
Plaintext

error: this `match` can be collapsed into the outer `match`
--> $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
--> $DIR/collapsible_match.rs:7:12
|
LL | Ok(val) => match val {
| ^^^ replace this binding
LL | Some(n) => foo(n),
| ^^^^^^^ with this pattern
error: this `match` can be collapsed into the outer `match`
--> $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
--> $DIR/collapsible_match.rs:16:12
|
LL | Ok(val) => match val {
| ^^^ replace this binding
LL | Some(n) => foo(n),
| ^^^^^^^ with this pattern
error: this `if let` can be collapsed into the outer `if let`
--> $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
--> $DIR/collapsible_match.rs:24:15
|
LL | if let Ok(val) = res_opt {
| ^^^ replace this binding
LL | if let Some(n) = val {
| ^^^^^^^ with this pattern
error: this `if let` can be collapsed into the outer `if let`
--> $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
--> $DIR/collapsible_match.rs:31:15
|
LL | if let Ok(val) = res_opt {
| ^^^ replace this binding
LL | if let Some(n) = val {
| ^^^^^^^ with this pattern
error: this `match` can be collapsed into the outer `if let`
--> $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
--> $DIR/collapsible_match.rs:42:15
|
LL | if let Ok(val) = res_opt {
| ^^^ replace this binding
LL | match val {
LL | Some(n) => foo(n),
| ^^^^^^^ with this pattern
error: this `if let` can be collapsed into the outer `match`
--> $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
--> $DIR/collapsible_match.rs:51:12
|
LL | Ok(val) => {
| ^^^ replace this binding
LL | if let Some(n) = val {
| ^^^^^^^ with this pattern
error: this `match` can be collapsed into the outer `if let`
--> $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
--> $DIR/collapsible_match.rs:60:15
|
LL | if let Ok(val) = res_opt {
| ^^^ replace this binding
LL | match val {
LL | Some(n) => foo(n),
| ^^^^^^^ with this pattern
error: this `if let` can be collapsed into the outer `match`
--> $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
--> $DIR/collapsible_match.rs:71:12
|
LL | Ok(val) => {
| ^^^ replace this binding
LL | if let Some(n) = val {
| ^^^^^^^ with this pattern
error: this `match` can be collapsed into the outer `match`
--> $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
--> $DIR/collapsible_match.rs:83:12
|
LL | Ok(val) => match val {
| ^^^ replace this binding
LL | Some(n) => foo(n),
| ^^^^^^^ with this pattern
error: this `match` can be collapsed into the outer `match`
--> $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
--> $DIR/collapsible_match.rs:92:14
|
LL | Some(val) => match val {
| ^^^ replace this binding
LL | Some(n) => foo(n),
| ^^^^^^^ with this pattern
error: aborting due to 10 previous errors