]>
Commit | Line | Data |
---|---|---|
f20569fa XL |
1 | use crate::utils::span_lint_and_help; |
2 | use rustc_hir as hir; | |
3 | use rustc_lint::LateContext; | |
4 | ||
5 | use super::SUSPICIOUS_MAP; | |
6 | ||
7 | pub(super) fn check(cx: &LateContext<'_>, expr: &hir::Expr<'_>) { | |
8 | span_lint_and_help( | |
9 | cx, | |
10 | SUSPICIOUS_MAP, | |
11 | expr.span, | |
12 | "this call to `map()` won't have an effect on the call to `count()`", | |
13 | None, | |
14 | "make sure you did not confuse `map` with `filter` or `for_each`", | |
15 | ); | |
16 | } |