Various small fixes

This commit is contained in:
Lukas Wirth 2023-09-22 08:08:00 +02:00
parent e63e323823
commit 556f0c6704
6 changed files with 22 additions and 20 deletions

View file

@ -498,10 +498,7 @@ impl_from!(Macro2Id, MacroRulesId, ProcMacroId for MacroId);
impl MacroId {
pub fn is_attribute(self, db: &dyn db::DefDatabase) -> bool {
match self {
MacroId::ProcMacroId(it) => it.lookup(db).kind == ProcMacroKind::Attr,
_ => false,
}
matches!(self, MacroId::ProcMacroId(it) if it.lookup(db).kind == ProcMacroKind::Attr)
}
}