]> git.lizzy.rs Git - rust.git/blobdiff - clippy_lints/src/methods/unnecessary_fold.rs
separate the receiver from arguments in HIR under /clippy
[rust.git] / clippy_lints / src / methods / unnecessary_fold.rs
index 47a811996085e59d95fa98475a33a0a367a9f1d8..c3531d4d0511e9e8f730dbc64e35190fc2228f53 100644 (file)
@@ -29,8 +29,8 @@ fn check_fold_with_op(
     ) {
         if_chain! {
             // Extract the body of the closure passed to fold
-            if let hir::ExprKind::Closure(_, _, body_id, _, _) = acc.kind;
-            let closure_body = cx.tcx.hir().body(body_id);
+            if let hir::ExprKind::Closure(&hir::Closure { body, .. }) = acc.kind;
+            let closure_body = cx.tcx.hir().body(body);
             let closure_expr = peel_blocks(&closure_body.value);
 
             // Check if the closure body is of the form `acc <op> some_expr(x)`