Closed
Description
Summary
single_match
should not lint an exhaustive match
Lint Name
single_match
Reproducer
I tried this code:
enum Foo { Bar }
match Some(Foo::Bar) {
Some(Foo::Bar) => {dbg!()}
None => {}
}
I saw this happen:
warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
--> src/main.rs:5:5
|
5 | / match Some(Foo::Bar) {
6 | | Some(Foo::Bar) => {dbg!()}
7 | | None => {}
8 | | }
| |_____^ help: try this: `if let Some(Foo::Bar) = Some(Foo::Bar) {dbg!()}`
I expected to see this happen: nothing
Version
No response
Additional Labels
No response