We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0b62b99 commit a9778c6Copy full SHA for a9778c6
crates/ide/src/syntax_highlighting.rs
@@ -455,15 +455,10 @@ fn macro_call_range(macro_call: &ast::MacroCall) -> Option<TextRange> {
455
}
456
457
fn is_possibly_unsafe(name_ref: &ast::NameRef) -> bool {
458
- name_ref
459
- .syntax()
460
- .parent()
461
- .and_then(|parent| {
462
- ast::FieldExpr::cast(parent.clone())
463
- .map(|_| true)
464
- .or_else(|| ast::RecordPatField::cast(parent).map(|_| true))
465
- })
466
- .unwrap_or(false)
+ match name_ref.syntax().parent() {
+ Some(parent) => matches!(parent.kind(), FIELD_EXPR | RECORD_PAT_FIELD),
+ None => false,
+ }
467
468
469
fn highlight_element(
0 commit comments