]> git.proxmox.com Git - rustc.git/blobdiff - src/tools/clippy/clippy_lints/src/methods/unnecessary_fold.rs
New upstream version 1.63.0+dfsg1
[rustc.git] / src / tools / clippy / clippy_lints / src / methods / unnecessary_fold.rs
index 47a811996085e59d95fa98475a33a0a367a9f1d8..913c4dbedc30113a2d193798954df144ca7d271c 100644 (file)
@@ -29,8 +29,8 @@ pub(super) fn check(
     ) {
         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 { 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)`