1
Fork 0

Make ExprKind::Closure a struct variant.

This commit is contained in:
Camille GILLOT 2022-06-11 21:25:25 +02:00
parent e34621c24e
commit 7b84a97c3e
36 changed files with 112 additions and 98 deletions

View 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)`