mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-12-30 15:03:36 +00:00
16 lines
439 B
Rust
16 lines
439 B
Rust
use crate::utils::span_lint_and_help;
|
|
use rustc_hir as hir;
|
|
use rustc_lint::LateContext;
|
|
|
|
use super::SUSPICIOUS_MAP;
|
|
|
|
pub(super) fn check(cx: &LateContext<'_>, expr: &hir::Expr<'_>) {
|
|
span_lint_and_help(
|
|
cx,
|
|
SUSPICIOUS_MAP,
|
|
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`",
|
|
);
|
|
}
|