Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir/src/lib.rs')
| -rw-r--r-- | crates/hir/src/lib.rs | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/crates/hir/src/lib.rs b/crates/hir/src/lib.rs index a9d15274fa..b45689ec37 100644 --- a/crates/hir/src/lib.rs +++ b/crates/hir/src/lib.rs @@ -1812,14 +1812,12 @@ impl Macro { pub fn is_builtin_derive(&self, db: &dyn HirDatabase) -> bool { match self.id { - MacroId::Macro2Id(it) => match it.lookup(db.upcast()).expander { - MacroExpander::BuiltInDerive(_) => true, - _ => false, - }, - MacroId::MacroRulesId(it) => match it.lookup(db.upcast()).expander { - MacroExpander::BuiltInDerive(_) => true, - _ => false, - }, + MacroId::Macro2Id(it) => { + matches!(it.lookup(db.upcast()).expander, MacroExpander::BuiltInDerive(_)) + } + MacroId::MacroRulesId(it) => { + matches!(it.lookup(db.upcast()).expander, MacroExpander::BuiltInDerive(_)) + } MacroId::ProcMacroId(_) => false, } } |