@@ -38,17 +38,17 @@ declare_lint_pass!(ByteCount => [NAIVE_BYTECOUNT]);
3838impl < ' tcx > LateLintPass < ' tcx > for ByteCount {
3939 fn check_expr ( & mut self , cx : & LateContext < ' _ > , expr : & Expr < ' _ > ) {
4040 if_chain ! {
41- if let ExprKind :: MethodCall ( ref count, _, ref count_args, _) = expr. kind;
41+ if let ExprKind :: MethodCall ( count, _, count_args, _) = expr. kind;
4242 if count. ident. name == sym!( count) ;
4343 if count_args. len( ) == 1 ;
44- if let ExprKind :: MethodCall ( ref filter, _, ref filter_args, _) = count_args[ 0 ] . kind;
44+ if let ExprKind :: MethodCall ( filter, _, filter_args, _) = count_args[ 0 ] . kind;
4545 if filter. ident. name == sym!( filter) ;
4646 if filter_args. len( ) == 2 ;
4747 if let ExprKind :: Closure ( _, _, body_id, _, _) = filter_args[ 1 ] . kind;
4848 let body = cx. tcx. hir( ) . body( body_id) ;
4949 if body. params. len( ) == 1 ;
50- if let Some ( argname) = get_pat_name( & body. params[ 0 ] . pat) ;
51- if let ExprKind :: Binary ( ref op, ref l , ref r) = body. value. kind;
50+ if let Some ( argname) = get_pat_name( body. params[ 0 ] . pat) ;
51+ if let ExprKind :: Binary ( ref op, l , r) = body. value. kind;
5252 if op. node == BinOpKind :: Eq ;
5353 if match_type( cx,
5454 cx. typeck_results( ) . expr_ty( & filter_args[ 0 ] ) . peel_refs( ) ,
@@ -64,7 +64,7 @@ impl<'tcx> LateLintPass<'tcx> for ByteCount {
6464 if ty:: Uint ( UintTy :: U8 ) != * cx. typeck_results( ) . expr_ty( needle) . peel_refs( ) . kind( ) {
6565 return ;
6666 }
67- let haystack = if let ExprKind :: MethodCall ( ref path, _, ref args, _) =
67+ let haystack = if let ExprKind :: MethodCall ( path, _, args, _) =
6868 filter_args[ 0 ] . kind {
6969 let p = path. ident. name;
7070 if ( p == sym:: iter || p == sym!( iter_mut) ) && args. len( ) == 1 {
@@ -98,10 +98,10 @@ fn check_arg(name: Symbol, arg: Symbol, needle: &Expr<'_>) -> bool {
9898
9999fn get_path_name ( expr : & Expr < ' _ > ) -> Option < Symbol > {
100100 match expr. kind {
101- ExprKind :: Box ( ref e) | ExprKind :: AddrOf ( BorrowKind :: Ref , _, ref e) | ExprKind :: Unary ( UnOp :: Deref , ref e) => {
101+ ExprKind :: Box ( e) | ExprKind :: AddrOf ( BorrowKind :: Ref , _, e) | ExprKind :: Unary ( UnOp :: Deref , e) => {
102102 get_path_name ( e)
103103 } ,
104- ExprKind :: Block ( ref b, _) => {
104+ ExprKind :: Block ( b, _) => {
105105 if b. stmts . is_empty ( ) {
106106 b. expr . as_ref ( ) . and_then ( |p| get_path_name ( p) )
107107 } else {
0 commit comments