diff options
Diffstat (limited to 'src/tools/clippy/src/docs/manual_filter_map.txt')
-rw-r--r-- | src/tools/clippy/src/docs/manual_filter_map.txt | 19 |
1 files changed, 0 insertions, 19 deletions
diff --git a/src/tools/clippy/src/docs/manual_filter_map.txt b/src/tools/clippy/src/docs/manual_filter_map.txt deleted file mode 100644 index 3b6860798..000000000 --- a/src/tools/clippy/src/docs/manual_filter_map.txt +++ /dev/null @@ -1,19 +0,0 @@ -### What it does -Checks for usage of `_.filter(_).map(_)` that can be written more simply -as `filter_map(_)`. - -### Why is this bad? -Redundant code in the `filter` and `map` operations is poor style and -less performant. - -### Example -``` -(0_i32..10) - .filter(|n| n.checked_add(1).is_some()) - .map(|n| n.checked_add(1).unwrap()); -``` - -Use instead: -``` -(0_i32..10).filter_map(|n| n.checked_add(1)); -```
\ No newline at end of file |