mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 20:42:04 +00:00
Format let-else
This commit is contained in:
parent
28fcd1bdd7
commit
69cd3c30ac
38 changed files with 572 additions and 306 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue