]> git.lizzy.rs Git - rust.git/blob - src/docs/flat_map_identity.txt
Auto merge of #9421 - xphoniex:fix-#9420, r=giraffate
[rust.git] / src / docs / flat_map_identity.txt
1 ### What it does
2 Checks for usage of `flat_map(|x| x)`.
3
4 ### Why is this bad?
5 Readability, this can be written more concisely by using `flatten`.
6
7 ### Example
8 ```
9 iter.flat_map(|x| x);
10 ```
11 Can be written as
12 ```
13 iter.flatten();
14 ```