Skip to content

Commit 11a1bb1

Browse files
committed
Inline trivial function
1 parent a9778c6 commit 11a1bb1

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

crates/ide/src/syntax_highlighting.rs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -454,13 +454,6 @@ fn macro_call_range(macro_call: &ast::MacroCall) -> Option<TextRange> {
454454
Some(TextRange::new(range_start, range_end))
455455
}
456456

457-
fn is_possibly_unsafe(name_ref: &ast::NameRef) -> bool {
458-
match name_ref.syntax().parent() {
459-
Some(parent) => matches!(parent.kind(), FIELD_EXPR | RECORD_PAT_FIELD),
460-
None => false,
461-
}
462-
}
463-
464457
fn highlight_element(
465458
sema: &Semantics<RootDatabase>,
466459
bindings_shadow_count: &mut FxHashMap<Name, u32>,
@@ -526,7 +519,12 @@ fn highlight_element(
526519
binding_hash = Some(calc_binding_hash(&name, *shadow_count))
527520
}
528521
};
529-
let possibly_unsafe = is_possibly_unsafe(&name_ref);
522+
let possibly_unsafe = match name_ref.syntax().parent() {
523+
Some(parent) => {
524+
matches!(parent.kind(), FIELD_EXPR | RECORD_PAT_FIELD)
525+
}
526+
None => false,
527+
};
530528
highlight_def(sema, db, def, Some(name_ref), possibly_unsafe)
531529
}
532530
NameRefClass::FieldShorthand { .. } => HighlightTag::Field.into(),

0 commit comments

Comments
 (0)