Closed
Description
The documentation for unnecessary_filter_map
gives
let _ = (0..4).filter_map(i32::checked_abs);
as an example of a filter_map
that can be replaced by a map
. However, it is incorrect.
As can be seen from the test and its associated output, that line is actually an example of good code which should not be caught by the lint.
Probably let _ = (0..4).filter_map(|x| Some(x + 1));
would be a good example to use in the documentation instead, as it can be replaced by let _ = (0..4).map(|x| x + 1);
Metadata
Metadata
Assignees
Labels
No labels