forked from rust-lang/rust
-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of rust-lang#10753 - disco07:master, r=xFrednet
redundant_pattern_matching This PR try to solve this issue rust-lang/rust-clippy#10726, but it enter in conflict with another test. changelog: none Try to test this: ``` let _w = match x { Some(_) => true, _ => false, }; ``` this happen: ``` error: match expression looks like `matches!` macro --> $DIR/match_expr_like_matches_macro.rs:21:14 | LL | let _w = match x { | ______________^ LL | | Some(_) => true, LL | | _ => false, LL | | }; | |_____^ help: try this: `matches!(x, Some(_))` +error: redundant pattern matching, consider using `is_some()` + --> $DIR/match_expr_like_matches_macro.rs:21:14 + | +LL | let _w = match x { + | ______________^ +LL | | Some(_) => true, +LL | | _ => false, +LL | | }; + | |_____^ help: try this: `x.is_some()` + | + = note: `-D clippy::redundant-pattern-matching` implied by `-D warnings` + ``` I need some help to fix this. Thanks
- Loading branch information
Showing
10 changed files
with
385 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.