Skip to content

Commit 68a649d

Browse files
committed
Simplify unsafe expr collection match
1 parent b7e25ba commit 68a649d

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

crates/ra_hir_ty/src/unsafe_validation.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,13 +108,12 @@ fn walk_unsafe(
108108
unsafe_exprs.push(UnsafeExpr { expr: current, inside_unsafe_block });
109109
}
110110
}
111+
Expr::Unsafe { body: child } => {
112+
return walk_unsafe(unsafe_exprs, db, infer, body, *child, true);
113+
}
111114
_ => {}
112115
}
113116

114-
if let &Expr::Unsafe { body: child } = expr {
115-
return walk_unsafe(unsafe_exprs, db, infer, body, child, true);
116-
}
117-
118117
expr.walk_child_exprs(|child| {
119118
walk_unsafe(unsafe_exprs, db, infer, body, child, inside_unsafe_block);
120119
});

0 commit comments

Comments
 (0)