]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/src/docs/wildcard_in_or_patterns.txt
Add 'src/tools/miri/' from commit '75dd959a3a40eb5b4574f8d2e23aa6efbeb33573'
[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 ```