]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/src/docs/manual_map.txt
Auto merge of #104673 - matthiaskrgr:rollup-85f65ov, r=matthiaskrgr
[rust.git] / src / tools / clippy / src / docs / manual_map.txt
1 ### What it does
2 Checks for usages of `match` which could be implemented using `map`
3
4 ### Why is this bad?
5 Using the `map` method is clearer and more concise.
6
7 ### Example
8 ```
9 match Some(0) {
10     Some(x) => Some(x + 1),
11     None => None,
12 };
13 ```
14 Use instead:
15 ```
16 Some(0).map(|x| x + 1);
17 ```