@@ -5,6 +5,7 @@ mod expect_used;
5
5
mod filetype_is_file;
6
6
mod filter_map;
7
7
mod filter_map_identity;
8
+ mod filter_map_map;
8
9
mod filter_next;
9
10
mod from_iter_instead_of_collect;
10
11
mod get_unwrap;
@@ -1700,7 +1701,7 @@ impl<'tcx> LateLintPass<'tcx> for Methods {
1700
1701
[ "next" , "skip_while" ] => skip_while_next:: check ( cx, expr, arg_lists[ 1 ] ) ,
1701
1702
[ "next" , "iter" ] => iter_next_slice:: check ( cx, expr, arg_lists[ 1 ] ) ,
1702
1703
[ "map" , "filter" ] => filter_map:: check ( cx, expr, false ) ,
1703
- [ "map" , "filter_map" ] => lint_filter_map_map ( cx, expr, arg_lists[ 1 ] , arg_lists[ 0 ] ) ,
1704
+ [ "map" , "filter_map" ] => filter_map_map :: check ( cx, expr, arg_lists[ 1 ] , arg_lists[ 0 ] ) ,
1704
1705
[ "next" , "filter_map" ] => lint_filter_map_next ( cx, expr, arg_lists[ 1 ] , self . msrv . as_ref ( ) ) ,
1705
1706
[ "map" , "find" ] => filter_map:: check ( cx, expr, true ) ,
1706
1707
[ "flat_map" , "filter" ] => lint_filter_flat_map ( cx, expr, arg_lists[ 1 ] , arg_lists[ 0 ] ) ,
@@ -2785,21 +2786,6 @@ fn lint_filter_map_next<'tcx>(
2785
2786
}
2786
2787
}
2787
2788
2788
- /// lint use of `filter_map().map()` for `Iterators`
2789
- fn lint_filter_map_map < ' tcx > (
2790
- cx : & LateContext < ' tcx > ,
2791
- expr : & ' tcx hir:: Expr < ' _ > ,
2792
- _filter_args : & ' tcx [ hir:: Expr < ' _ > ] ,
2793
- _map_args : & ' tcx [ hir:: Expr < ' _ > ] ,
2794
- ) {
2795
- // lint if caller of `.filter_map().map()` is an Iterator
2796
- if match_trait_method ( cx, expr, & paths:: ITERATOR ) {
2797
- let msg = "called `filter_map(..).map(..)` on an `Iterator`" ;
2798
- let hint = "this is more succinctly expressed by only calling `.filter_map(..)` instead" ;
2799
- span_lint_and_help ( cx, FILTER_MAP , expr. span , msg, None , hint) ;
2800
- }
2801
- }
2802
-
2803
2789
/// lint use of `filter().flat_map()` for `Iterators`
2804
2790
fn lint_filter_flat_map < ' tcx > (
2805
2791
cx : & LateContext < ' tcx > ,
0 commit comments