@@ -786,16 +786,16 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Pass {
786
786
787
787
let ( method_names, arg_lists) = method_calls ( expr, 2 ) ;
788
788
let method_names: Vec < LocalInternedString > = method_names. iter ( ) . map ( |s| s. as_str ( ) ) . collect ( ) ;
789
- let mut method_names = method_names. iter ( ) . map ( |s| s. as_ref ( ) ) . chain ( iter :: repeat ( "" ) ) ;
789
+ let method_names: Vec < & str > = method_names. iter ( ) . map ( |s| s. as_ref ( ) ) . collect ( ) ;
790
790
791
- match [ method_names. next ( ) . unwrap ( ) , method_names . next ( ) . unwrap ( ) ] {
791
+ match method_names. as_slice ( ) {
792
792
[ "unwrap" , "get" ] => lint_get_unwrap ( cx, expr, arg_lists[ 1 ] , false ) ,
793
793
[ "unwrap" , "get_mut" ] => lint_get_unwrap ( cx, expr, arg_lists[ 1 ] , true ) ,
794
- [ "unwrap" , _ ] => lint_unwrap ( cx, expr, arg_lists[ 0 ] ) ,
794
+ [ "unwrap" , .. ] => lint_unwrap ( cx, expr, arg_lists[ 0 ] ) ,
795
795
[ "expect" , "ok" ] => lint_ok_expect ( cx, expr, arg_lists[ 1 ] ) ,
796
796
[ "unwrap_or" , "map" ] => lint_map_unwrap_or ( cx, expr, arg_lists[ 1 ] , arg_lists[ 0 ] ) ,
797
797
[ "unwrap_or_else" , "map" ] => lint_map_unwrap_or_else ( cx, expr, arg_lists[ 1 ] , arg_lists[ 0 ] ) ,
798
- [ "map_or" , _ ] => lint_map_or_none ( cx, expr, arg_lists[ 0 ] ) ,
798
+ [ "map_or" , .. ] => lint_map_or_none ( cx, expr, arg_lists[ 0 ] ) ,
799
799
[ "next" , "filter" ] => lint_filter_next ( cx, expr, arg_lists[ 1 ] ) ,
800
800
[ "map" , "filter" ] => lint_filter_map ( cx, expr, arg_lists[ 1 ] , arg_lists[ 0 ] ) ,
801
801
[ "map" , "filter_map" ] => lint_filter_map_map ( cx, expr, arg_lists[ 1 ] , arg_lists[ 0 ] ) ,
@@ -805,16 +805,16 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Pass {
805
805
[ "is_some" , "find" ] => lint_search_is_some ( cx, expr, "find" , arg_lists[ 1 ] , arg_lists[ 0 ] ) ,
806
806
[ "is_some" , "position" ] => lint_search_is_some ( cx, expr, "position" , arg_lists[ 1 ] , arg_lists[ 0 ] ) ,
807
807
[ "is_some" , "rposition" ] => lint_search_is_some ( cx, expr, "rposition" , arg_lists[ 1 ] , arg_lists[ 0 ] ) ,
808
- [ "extend" , _ ] => lint_extend ( cx, expr, arg_lists[ 0 ] ) ,
808
+ [ "extend" , .. ] => lint_extend ( cx, expr, arg_lists[ 0 ] ) ,
809
809
[ "as_ptr" , "unwrap" ] => lint_cstring_as_ptr ( cx, expr, & arg_lists[ 1 ] [ 0 ] , & arg_lists[ 0 ] [ 0 ] ) ,
810
810
[ "nth" , "iter" ] => lint_iter_nth ( cx, expr, arg_lists[ 1 ] , false ) ,
811
811
[ "nth" , "iter_mut" ] => lint_iter_nth ( cx, expr, arg_lists[ 1 ] , true ) ,
812
812
[ "next" , "skip" ] => lint_iter_skip_next ( cx, expr) ,
813
813
[ "collect" , "cloned" ] => lint_iter_cloned_collect ( cx, expr, arg_lists[ 1 ] ) ,
814
- [ "as_ref" , _ ] => lint_asref ( cx, expr, "as_ref" , arg_lists[ 0 ] ) ,
815
- [ "as_mut" , _ ] => lint_asref ( cx, expr, "as_mut" , arg_lists[ 0 ] ) ,
816
- [ "fold" , _ ] => lint_unnecessary_fold ( cx, expr, arg_lists[ 0 ] ) ,
817
- [ "filter_map" , _ ] => unnecessary_filter_map:: lint ( cx, expr, arg_lists[ 0 ] ) ,
814
+ [ "as_ref" , .. ] => lint_asref ( cx, expr, "as_ref" , arg_lists[ 0 ] ) ,
815
+ [ "as_mut" , .. ] => lint_asref ( cx, expr, "as_mut" , arg_lists[ 0 ] ) ,
816
+ [ "fold" , .. ] => lint_unnecessary_fold ( cx, expr, arg_lists[ 0 ] ) ,
817
+ [ "filter_map" , .. ] => unnecessary_filter_map:: lint ( cx, expr, arg_lists[ 0 ] ) ,
818
818
_ => { }
819
819
}
820
820
0 commit comments