mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-12-20 18:13:36 +00:00
62 lines
2.1 KiB
Text
62 lines
2.1 KiB
Text
|
error: Unnecessary nested match
|
||
|
--> $DIR/collapsible_match2.rs:8:34
|
||
|
|
|
||
|
LL | Ok(val) if make() => 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_match2.rs:8:16
|
||
|
|
|
||
|
LL | Ok(val) if make() => match val {
|
||
|
| ^^^ Replace this binding
|
||
|
LL | Some(n) => foo(n),
|
||
|
| ^^^^^^^ with this pattern
|
||
|
|
||
|
error: Unnecessary nested match
|
||
|
--> $DIR/collapsible_match2.rs:15:24
|
||
|
|
|
||
|
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_match2.rs:15:16
|
||
|
|
|
||
|
LL | Ok(val) => match val {
|
||
|
| ^^^ Replace this binding
|
||
|
LL | Some(n) => foo(n),
|
||
|
| ^^^^^^^ with this pattern
|
||
|
|
||
|
error: Unnecessary nested match
|
||
|
--> $DIR/collapsible_match2.rs:29:29
|
||
|
|
|
||
|
LL | $pat => match $e {
|
||
|
| _____________________________^
|
||
|
LL | | $inner_pat => $then,
|
||
|
LL | | _ => return,
|
||
|
LL | | },
|
||
|
| |_____________________^
|
||
|
...
|
||
|
LL | mac!(res_opt => Ok(val), val => Some(n), foo(n));
|
||
|
| ------------------------------------------------- in this macro invocation
|
||
|
|
|
||
|
help: The outer pattern can be modified to include the inner pattern.
|
||
|
--> $DIR/collapsible_match2.rs:41:28
|
||
|
|
|
||
|
LL | mac!(res_opt => Ok(val), val => Some(n), foo(n));
|
||
|
| ^^^ ^^^^^^^ with this pattern
|
||
|
| |
|
||
|
| Replace this binding
|
||
|
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||
|
|
||
|
error: aborting due to 3 previous errors
|
||
|
|