summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/src/docs/manual_map.txt
blob: 7f68ccd1037e3fb4f89927bdb1d7f7d7ba7e5544 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
### What it does
Checks for usages of `match` which could be implemented using `map`

### Why is this bad?
Using the `map` method is clearer and more concise.

### Example
```
match Some(0) {
    Some(x) => Some(x + 1),
    None => None,
};
```
Use instead:
```
Some(0).map(|x| x + 1);
```