mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-03 15:15:24 +00:00
Simplify
This commit is contained in:
parent
0b62b990ba
commit
a9778c6d73
1 changed files with 4 additions and 9 deletions
|
@ -455,15 +455,10 @@ fn macro_call_range(macro_call: &ast::MacroCall) -> Option<TextRange> {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn is_possibly_unsafe(name_ref: &ast::NameRef) -> bool {
|
fn is_possibly_unsafe(name_ref: &ast::NameRef) -> bool {
|
||||||
name_ref
|
match name_ref.syntax().parent() {
|
||||||
.syntax()
|
Some(parent) => matches!(parent.kind(), FIELD_EXPR | RECORD_PAT_FIELD),
|
||||||
.parent()
|
None => false,
|
||||||
.and_then(|parent| {
|
}
|
||||||
ast::FieldExpr::cast(parent.clone())
|
|
||||||
.map(|_| true)
|
|
||||||
.or_else(|| ast::RecordPatField::cast(parent).map(|_| true))
|
|
||||||
})
|
|
||||||
.unwrap_or(false)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn highlight_element(
|
fn highlight_element(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue