Skip to content

Commit 6e8c2bf

Browse files
committed
Fix documentation example for unnecessary_filter_map.
1 parent 584f95f commit 6e8c2bf

File tree

1 file changed

+2
-2
lines changed
  • clippy_lints/src/methods

1 file changed

+2
-2
lines changed

clippy_lints/src/methods/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -958,11 +958,11 @@ declare_clippy_lint! {
958958
/// ```
959959
///
960960
/// ```rust
961-
/// let _ = (0..4).filter_map(i32::checked_abs);
961+
/// let _ = (0..4).filter_map(|x| Some(x + 1));
962962
/// ```
963963
/// As there is no conditional check on the argument this could be written as:
964964
/// ```rust
965-
/// let _ = (0..4).map(i32::checked_abs);
965+
/// let _ = (0..4).map(|x| x + 1);
966966
/// ```
967967
pub UNNECESSARY_FILTER_MAP,
968968
complexity,

0 commit comments

Comments
 (0)