Format let-else

This commit is contained in:
Lukas Wirth 2023-07-03 20:34:09 +02:00
parent 28fcd1bdd7
commit 69cd3c30ac
38 changed files with 572 additions and 306 deletions

View file

@ -1494,7 +1494,11 @@ impl<'db> SemanticsImpl<'db> {
}
fn is_inside_unsafe(&self, expr: &ast::Expr) -> bool {
let Some(enclosing_item) = expr.syntax().ancestors().find_map(Either::<ast::Item, ast::Variant>::cast) else { return false };
let Some(enclosing_item) =
expr.syntax().ancestors().find_map(Either::<ast::Item, ast::Variant>::cast)
else {
return false;
};
let def = match &enclosing_item {
Either::Left(ast::Item::Fn(it)) if it.unsafe_token().is_some() => return true,