summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/src/docs/match_single_binding.txt
blob: 67ded0bbd5534601fc2158b1eee91284bf00dd14 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
### What it does
Checks for useless match that binds to only one value.

### Why is this bad?
Readability and needless complexity.

### Known problems
 Suggested replacements may be incorrect when `match`
is actually binding temporary value, bringing a 'dropped while borrowed' error.

### Example
```
match (a, b) {
    (c, d) => {
        // useless match
    }
}
```

Use instead:
```
let (c, d) = (a, b);
```