diff options
| author | Matthias Kaak <m.kaak@protonmail.ch> | 2021-10-05 19:03:13 +0000 |
|---|---|---|
| committer | Matthias Kaak <m.kaak@protonmail.ch> | 2021-10-05 19:09:08 +0000 |
| commit | 7c82e78f308b35b40f424527b6d7961a81280529 (patch) | |
| tree | 8fa17db2197fc2ae00b2b2553629b9e762575cfa | |
| parent | abe551ecb7f0f6223f3d343a591eb34d0b332708 (diff) | |
| download | rust-7c82e78f308b35b40f424527b6d7961a81280529.tar.gz rust-7c82e78f308b35b40f424527b6d7961a81280529.zip | |
improved help message for `suspicious_map`
| -rw-r--r-- | clippy_lints/src/methods/suspicious_map.rs | 2 | ||||
| -rw-r--r-- | tests/ui/suspicious_map.stderr | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/clippy_lints/src/methods/suspicious_map.rs b/clippy_lints/src/methods/suspicious_map.rs index 0fd0668c734..18ded291915 100644 --- a/clippy_lints/src/methods/suspicious_map.rs +++ b/clippy_lints/src/methods/suspicious_map.rs @@ -28,7 +28,7 @@ pub fn check<'tcx>(cx: &LateContext<'tcx>, expr: &hir::Expr<'_>, count_recv: &hi expr.span, "this call to `map()` won't have an effect on the call to `count()`", None, - "make sure you did not confuse `map` with `filter` or `for_each`", + "make sure you did not confuse `map` with `filter`, `for_each` or `inspect`", ); } } diff --git a/tests/ui/suspicious_map.stderr b/tests/ui/suspicious_map.stderr index 8c3f36584a5..3ffcd1a9031 100644 --- a/tests/ui/suspicious_map.stderr +++ b/tests/ui/suspicious_map.stderr @@ -5,7 +5,7 @@ LL | let _ = (0..3).map(|x| x + 2).count(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: `-D clippy::suspicious-map` implied by `-D warnings` - = help: make sure you did not confuse `map` with `filter` or `for_each` + = help: make sure you did not confuse `map` with `filter`, `for_each` or `inspect` error: this call to `map()` won't have an effect on the call to `count()` --> $DIR/suspicious_map.rs:7:13 @@ -13,7 +13,7 @@ error: this call to `map()` won't have an effect on the call to `count()` LL | let _ = (0..3).map(f).count(); | ^^^^^^^^^^^^^^^^^^^^^ | - = help: make sure you did not confuse `map` with `filter` or `for_each` + = help: make sure you did not confuse `map` with `filter`, `for_each` or `inspect` error: aborting due to 2 previous errors |
