]> git.lizzy.rs Git - rust.git/blobdiff - clippy_lints/src/bytecount.rs
Auto merge of #8487 - dswij:8478, r=giraffate
[rust.git] / clippy_lints / src / bytecount.rs
index 657c1f88c7db5055bd8714fe0329d9a9a9bde694..02d97bf43df83d50587d50b9669ee205230766a4 100644 (file)
@@ -41,9 +41,9 @@
 impl<'tcx> LateLintPass<'tcx> for ByteCount {
     fn check_expr(&mut self, cx: &LateContext<'_>, expr: &Expr<'_>) {
         if_chain! {
-            if let ExprKind::MethodCall(count, _, [count_recv], _) = expr.kind;
-            if count.ident.name == sym!(count);
-            if let ExprKind::MethodCall(filter, _, [filter_recv, filter_arg], _) = count_recv.kind;
+            if let ExprKind::MethodCall(count, [count_recv], _) = expr.kind;
+            if count.ident.name == sym::count;
+            if let ExprKind::MethodCall(filter, [filter_recv, filter_arg], _) = count_recv.kind;
             if filter.ident.name == sym!(filter);
             if let ExprKind::Closure(_, _, body_id, _, _) = filter_arg.kind;
             let body = cx.tcx.hir().body(body_id);
@@ -68,7 +68,7 @@ fn check_expr(&mut self, cx: &LateContext<'_>, expr: &Expr<'_>) {
             if ty::Uint(UintTy::U8) == *cx.typeck_results().expr_ty(needle).peel_refs().kind();
             if !is_local_used(cx, needle, arg_id);
             then {
-                let haystack = if let ExprKind::MethodCall(path, _, args, _) =
+                let haystack = if let ExprKind::MethodCall(path, args, _) =
                         filter_recv.kind {
                     let p = path.ident.name;
                     if (p == sym::iter || p == sym!(iter_mut)) && args.len() == 1 {