]>
Commit | Line | Data |
---|---|---|
f2b60f7d FG |
1 | ### What it does |
2 | Checks for unnecessary '..' pattern binding on struct when all fields are explicitly matched. | |
3 | ||
4 | ### Why is this bad? | |
5 | Correctness and readability. It's like having a wildcard pattern after | |
6 | matching all enum variants explicitly. | |
7 | ||
8 | ### Example | |
9 | ``` | |
10 | let a = A { a: 5 }; | |
11 | ||
12 | match a { | |
13 | A { a: 5, .. } => {}, | |
14 | _ => {}, | |
15 | } | |
16 | ``` | |
17 | ||
18 | Use instead: | |
19 | ``` | |
20 | match a { | |
21 | A { a: 5 } => {}, | |
22 | _ => {}, | |
23 | } | |
24 | ``` |