@@ -13,6 +13,7 @@ mod ok_expect;
13
13
mod option_as_ref_deref;
14
14
mod option_map_unwrap_or;
15
15
mod skip_while_next;
16
+ mod suspicious_map;
16
17
mod unnecessary_filter_map;
17
18
mod unnecessary_lazy_eval;
18
19
mod unwrap_used;
@@ -1716,7 +1717,7 @@ impl<'tcx> LateLintPass<'tcx> for Methods {
1716
1717
unnecessary_filter_map:: lint ( cx, expr, arg_lists[ 0 ] ) ;
1717
1718
filter_map_identity:: check ( cx, expr, arg_lists[ 0 ] , method_spans[ 0 ] ) ;
1718
1719
} ,
1719
- [ "count" , "map" ] => lint_suspicious_map ( cx, expr) ,
1720
+ [ "count" , "map" ] => suspicious_map :: check ( cx, expr) ,
1720
1721
[ "assume_init" ] => lint_maybe_uninit ( cx, & arg_lists[ 0 ] [ 0 ] , expr) ,
1721
1722
[ "unwrap_or" , arith @ ( "checked_add" | "checked_sub" | "checked_mul" ) ] => {
1722
1723
manual_saturating_arithmetic:: lint ( cx, expr, & arg_lists, & arith[ "checked_" . len ( ) ..] )
@@ -3574,17 +3575,6 @@ fn is_maybe_uninit_ty_valid(cx: &LateContext<'_>, ty: Ty<'_>) -> bool {
3574
3575
}
3575
3576
}
3576
3577
3577
- fn lint_suspicious_map ( cx : & LateContext < ' _ > , expr : & hir:: Expr < ' _ > ) {
3578
- span_lint_and_help (
3579
- cx,
3580
- SUSPICIOUS_MAP ,
3581
- expr. span ,
3582
- "this call to `map()` won't have an effect on the call to `count()`" ,
3583
- None ,
3584
- "make sure you did not confuse `map` with `filter` or `for_each`" ,
3585
- ) ;
3586
- }
3587
-
3588
3578
fn lint_map_collect (
3589
3579
cx : & LateContext < ' _ > ,
3590
3580
expr : & hir:: Expr < ' _ > ,
0 commit comments