]> git.proxmox.com Git - rustc.git/blob - src/tools/clippy/src/docs/rest_pat_in_fully_bound_structs.txt
New upstream version 1.65.0+dfsg1
[rustc.git] / src / tools / clippy / src / docs / rest_pat_in_fully_bound_structs.txt
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 ```