mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 14:21:44 +00:00
Simplify
This commit is contained in:
parent
b66f181bc0
commit
e09d410dcd
5 changed files with 35 additions and 36 deletions
|
@ -171,6 +171,18 @@ pub enum SymbolKind {
|
|||
Variant,
|
||||
}
|
||||
|
||||
impl From<hir::MacroKind> for SymbolKind {
|
||||
fn from(it: hir::MacroKind) -> Self {
|
||||
match it {
|
||||
hir::MacroKind::Declarative | hir::MacroKind::BuiltIn | hir::MacroKind::ProcMacro => {
|
||||
SymbolKind::Macro
|
||||
}
|
||||
hir::MacroKind::Derive => SymbolKind::Derive,
|
||||
hir::MacroKind::Attr => SymbolKind::Attribute,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
mod sourcegen_lints;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue