]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/src/docs/wildcard_in_or_patterns.txt
Auto merge of #100502 - chenyukang:fix-100478, r=jackh726
[rust.git] / src / tools / clippy / src / docs / wildcard_in_or_patterns.txt
1 ### What it does
2 Checks for wildcard pattern used with others patterns in same match arm.
3
4 ### Why is this bad?
5 Wildcard pattern already covers any other pattern as it will match anyway.
6 It makes the code less readable, especially to spot wildcard pattern use in match arm.
7
8 ### Example
9 ```
10 match s {
11     "a" => {},
12     "bar" | _ => {},
13 }
14 ```
15
16 Use instead:
17 ```
18 match s {
19     "a" => {},
20     _ => {},
21 }
22 ```