Simplify unsafe expr collection match

This commit is contained in:
Paul Daniel Faria 2020-06-27 12:00:46 -04:00
parent b7e25ba854
commit 68a649d547

View file

@ -108,11 +108,10 @@ fn walk_unsafe(
unsafe_exprs.push(UnsafeExpr { expr: current, inside_unsafe_block }); 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| { expr.walk_child_exprs(|child| {