diff options
Diffstat (limited to 'src/tools/clippy/src/docs/flat_map_identity.txt')
-rw-r--r-- | src/tools/clippy/src/docs/flat_map_identity.txt | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/tools/clippy/src/docs/flat_map_identity.txt b/src/tools/clippy/src/docs/flat_map_identity.txt new file mode 100644 index 000000000..a5ee79b49 --- /dev/null +++ b/src/tools/clippy/src/docs/flat_map_identity.txt @@ -0,0 +1,14 @@ +### What it does +Checks for usage of `flat_map(|x| x)`. + +### Why is this bad? +Readability, this can be written more concisely by using `flatten`. + +### Example +``` +iter.flat_map(|x| x); +``` +Can be written as +``` +iter.flatten(); +```
\ No newline at end of file |