@@ -1673,14 +1673,14 @@ impl<'tcx> LateLintPass<'tcx> for Methods {
1673
1673
} ,
1674
1674
[ "map_or" , ..] => lint_map_or_none ( cx, expr, arg_lists[ 0 ] ) ,
1675
1675
[ "and_then" , ..] => {
1676
- let biom_option_linted = bind_instead_of_map:: OptionAndThenSome :: lint ( cx, expr, arg_lists[ 0 ] ) ;
1677
- let biom_result_linted = bind_instead_of_map:: ResultAndThenOk :: lint ( cx, expr, arg_lists[ 0 ] ) ;
1676
+ let biom_option_linted = bind_instead_of_map:: OptionAndThenSome :: check ( cx, expr, arg_lists[ 0 ] ) ;
1677
+ let biom_result_linted = bind_instead_of_map:: ResultAndThenOk :: check ( cx, expr, arg_lists[ 0 ] ) ;
1678
1678
if !biom_option_linted && !biom_result_linted {
1679
1679
unnecessary_lazy_eval:: check ( cx, expr, arg_lists[ 0 ] , "and" ) ;
1680
1680
}
1681
1681
} ,
1682
1682
[ "or_else" , ..] => {
1683
- if !bind_instead_of_map:: ResultOrElseErrInfo :: lint ( cx, expr, arg_lists[ 0 ] ) {
1683
+ if !bind_instead_of_map:: ResultOrElseErrInfo :: check ( cx, expr, arg_lists[ 0 ] ) {
1684
1684
unnecessary_lazy_eval:: check ( cx, expr, arg_lists[ 0 ] , "or" ) ;
1685
1685
}
1686
1686
} ,
@@ -1703,12 +1703,12 @@ impl<'tcx> LateLintPass<'tcx> for Methods {
1703
1703
lint_search_is_some ( cx, expr, "rposition" , arg_lists[ 1 ] , arg_lists[ 0 ] , method_spans[ 1 ] )
1704
1704
} ,
1705
1705
[ "extend" , ..] => lint_extend ( cx, expr, arg_lists[ 0 ] ) ,
1706
- [ "count" , "into_iter" ] => iter_count:: lints ( cx, expr, & arg_lists[ 1 ] , "into_iter" ) ,
1707
- [ "count" , "iter" ] => iter_count:: lints ( cx, expr, & arg_lists[ 1 ] , "iter" ) ,
1708
- [ "count" , "iter_mut" ] => iter_count:: lints ( cx, expr, & arg_lists[ 1 ] , "iter_mut" ) ,
1706
+ [ "count" , "into_iter" ] => iter_count:: check ( cx, expr, & arg_lists[ 1 ] , "into_iter" ) ,
1707
+ [ "count" , "iter" ] => iter_count:: check ( cx, expr, & arg_lists[ 1 ] , "iter" ) ,
1708
+ [ "count" , "iter_mut" ] => iter_count:: check ( cx, expr, & arg_lists[ 1 ] , "iter_mut" ) ,
1709
1709
[ "nth" , "iter" ] => lint_iter_nth ( cx, expr, & arg_lists, false ) ,
1710
1710
[ "nth" , "iter_mut" ] => lint_iter_nth ( cx, expr, & arg_lists, true ) ,
1711
- [ "nth" , "bytes" ] => bytes_nth:: lints ( cx, expr, & arg_lists[ 1 ] ) ,
1711
+ [ "nth" , "bytes" ] => bytes_nth:: check ( cx, expr, & arg_lists[ 1 ] ) ,
1712
1712
[ "nth" , ..] => lint_iter_nth_zero ( cx, expr, arg_lists[ 0 ] ) ,
1713
1713
[ "step_by" , ..] => lint_step_by ( cx, expr, arg_lists[ 0 ] ) ,
1714
1714
[ "next" , "skip" ] => lint_iter_skip_next ( cx, expr, arg_lists[ 1 ] ) ,
@@ -1717,13 +1717,13 @@ impl<'tcx> LateLintPass<'tcx> for Methods {
1717
1717
[ "as_mut" ] => lint_asref ( cx, expr, "as_mut" , arg_lists[ 0 ] ) ,
1718
1718
[ "fold" , ..] => lint_unnecessary_fold ( cx, expr, arg_lists[ 0 ] , method_spans[ 0 ] ) ,
1719
1719
[ "filter_map" , ..] => {
1720
- unnecessary_filter_map:: lint ( cx, expr, arg_lists[ 0 ] ) ;
1720
+ unnecessary_filter_map:: check ( cx, expr, arg_lists[ 0 ] ) ;
1721
1721
filter_map_identity:: check ( cx, expr, arg_lists[ 0 ] , method_spans[ 0 ] ) ;
1722
1722
} ,
1723
1723
[ "count" , "map" ] => suspicious_map:: check ( cx, expr) ,
1724
1724
[ "assume_init" ] => uninit_assumed_init:: check ( cx, & arg_lists[ 0 ] [ 0 ] , expr) ,
1725
1725
[ "unwrap_or" , arith @ ( "checked_add" | "checked_sub" | "checked_mul" ) ] => {
1726
- manual_saturating_arithmetic:: lint ( cx, expr, & arg_lists, & arith[ "checked_" . len ( ) ..] )
1726
+ manual_saturating_arithmetic:: check ( cx, expr, & arg_lists, & arith[ "checked_" . len ( ) ..] )
1727
1727
} ,
1728
1728
[ "add" | "offset" | "sub" | "wrapping_offset" | "wrapping_add" | "wrapping_sub" ] => {
1729
1729
check_pointer_offset ( cx, expr, arg_lists[ 0 ] )
@@ -1739,7 +1739,7 @@ impl<'tcx> LateLintPass<'tcx> for Methods {
1739
1739
[ "get_or_insert_with" , ..] => unnecessary_lazy_eval:: check ( cx, expr, arg_lists[ 0 ] , "get_or_insert" ) ,
1740
1740
[ "ok_or_else" , ..] => unnecessary_lazy_eval:: check ( cx, expr, arg_lists[ 0 ] , "ok_or" ) ,
1741
1741
[ "collect" , "map" ] => lint_map_collect ( cx, expr, arg_lists[ 1 ] , arg_lists[ 0 ] ) ,
1742
- [ "for_each" , "inspect" ] => inspect_for_each:: lint ( cx, expr, method_spans[ 1 ] ) ,
1742
+ [ "for_each" , "inspect" ] => inspect_for_each:: check ( cx, expr, method_spans[ 1 ] ) ,
1743
1743
[ "to_owned" , ..] => implicit_clone:: check ( cx, expr, sym:: ToOwned ) ,
1744
1744
[ "to_os_string" , ..] => implicit_clone:: check ( cx, expr, sym:: OsStr ) ,
1745
1745
[ "to_path_buf" , ..] => implicit_clone:: check ( cx, expr, sym:: Path ) ,
@@ -1765,7 +1765,7 @@ impl<'tcx> LateLintPass<'tcx> for Methods {
1765
1765
lint_clone_on_ref_ptr ( cx, expr, & args[ 0 ] ) ;
1766
1766
}
1767
1767
if args. len ( ) == 1 && method_call. ident . name == sym ! ( to_string) {
1768
- inefficient_to_string:: lint ( cx, expr, & args[ 0 ] , self_ty) ;
1768
+ inefficient_to_string:: check ( cx, expr, & args[ 0 ] , self_ty) ;
1769
1769
}
1770
1770
1771
1771
if let Some ( fn_def_id) = cx. typeck_results ( ) . type_dependent_def_id ( expr. hir_id ) {
0 commit comments