Skip to content

Commit 7c82e78

Browse files
committed
improved help message for suspicious_map
1 parent abe551e commit 7c82e78

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

clippy_lints/src/methods/suspicious_map.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ pub fn check<'tcx>(cx: &LateContext<'tcx>, expr: &hir::Expr<'_>, count_recv: &hi
2828
expr.span,
2929
"this call to `map()` won't have an effect on the call to `count()`",
3030
None,
31-
"make sure you did not confuse `map` with `filter` or `for_each`",
31+
"make sure you did not confuse `map` with `filter`, `for_each` or `inspect`",
3232
);
3333
}
3434
}

tests/ui/suspicious_map.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ LL | let _ = (0..3).map(|x| x + 2).count();
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
66
|
77
= note: `-D clippy::suspicious-map` implied by `-D warnings`
8-
= help: make sure you did not confuse `map` with `filter` or `for_each`
8+
= help: make sure you did not confuse `map` with `filter`, `for_each` or `inspect`
99

1010
error: this call to `map()` won't have an effect on the call to `count()`
1111
--> $DIR/suspicious_map.rs:7:13
1212
|
1313
LL | let _ = (0..3).map(f).count();
1414
| ^^^^^^^^^^^^^^^^^^^^^
1515
|
16-
= help: make sure you did not confuse `map` with `filter` or `for_each`
16+
= help: make sure you did not confuse `map` with `filter`, `for_each` or `inspect`
1717

1818
error: aborting due to 2 previous errors
1919

0 commit comments

Comments
 (0)