]> git.lizzy.rs Git - rust.git/blob - src/docs/match_wildcard_for_single_variants.txt
Auto merge of #9421 - xphoniex:fix-#9420, r=giraffate
[rust.git] / src / docs / match_wildcard_for_single_variants.txt
1 ### What it does
2 Checks for wildcard enum matches for a single variant.
3
4 ### Why is this bad?
5 New enum variants added by library updates can be missed.
6
7 ### Known problems
8 Suggested replacements may not use correct path to enum
9 if it's not present in the current scope.
10
11 ### Example
12 ```
13 match x {
14     Foo::A => {},
15     Foo::B => {},
16     _ => {},
17 }
18 ```
19
20 Use instead:
21 ```
22 match x {
23     Foo::A => {},
24     Foo::B => {},
25     Foo::C => {},
26 }
27 ```