mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 12:29:21 +00:00
Simplify
This commit is contained in:
parent
b36f12dba5
commit
83e97adfff
2 changed files with 9 additions and 110 deletions
|
@ -250,11 +250,7 @@ fn generate_nodes(kinds: KindsSrc<'_>, grammar: &AstSrc) -> String {
|
|||
}
|
||||
}
|
||||
fn cast(syntax: SyntaxNode) -> Option<Self> {
|
||||
match syntax.kind() {
|
||||
#(#kinds)|* => Some(#name { syntax }),
|
||||
_ => None,
|
||||
}
|
||||
|
||||
Self::can_cast(syntax.kind()).then(|| #name { syntax })
|
||||
}
|
||||
fn syntax(&self) -> &SyntaxNode {
|
||||
&self.syntax
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue