Skip to content

Commit b4ad56e

Browse files
committed
Auto merge of #4920 - lily-commure:fix-unnecessary-filter-map-docs, r=phansch
Fix documentation example for unnecessary_filter_map. Fixes #4919. changelog: none
2 parents a86463c + 6e8c2bf commit b4ad56e

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -977,11 +977,11 @@ declare_clippy_lint! {
977977
/// ```
978978
///
979979
/// ```rust
980-
/// let _ = (0..4).filter_map(i32::checked_abs);
980+
/// let _ = (0..4).filter_map(|x| Some(x + 1));
981981
/// ```
982982
/// As there is no conditional check on the argument this could be written as:
983983
/// ```rust
984-
/// let _ = (0..4).map(i32::checked_abs);
984+
/// let _ = (0..4).map(|x| x + 1);
985985
/// ```
986986
pub UNNECESSARY_FILTER_MAP,
987987
complexity,

0 commit comments

Comments
 (0)