From 68a649d547c844cb44ee619b7f45d1193dad2b02 Mon Sep 17 00:00:00 2001 From: Paul Daniel Faria Date: Sat, 27 Jun 2020 12:00:46 -0400 Subject: Simplify unsafe expr collection match --- crates/ra_hir_ty/src/unsafe_validation.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'crates') diff --git a/crates/ra_hir_ty/src/unsafe_validation.rs b/crates/ra_hir_ty/src/unsafe_validation.rs index aad13d99c..c512c4f8e 100644 --- a/crates/ra_hir_ty/src/unsafe_validation.rs +++ b/crates/ra_hir_ty/src/unsafe_validation.rs @@ -108,13 +108,12 @@ fn walk_unsafe( unsafe_exprs.push(UnsafeExpr { expr: current, inside_unsafe_block }); } } + Expr::Unsafe { body: child } => { + return walk_unsafe(unsafe_exprs, db, infer, body, *child, true); + } _ => {} } - if let &Expr::Unsafe { body: child } = expr { - return walk_unsafe(unsafe_exprs, db, infer, body, child, true); - } - expr.walk_child_exprs(|child| { walk_unsafe(unsafe_exprs, db, infer, body, child, inside_unsafe_block); }); -- cgit v1.2.3