remove unnecessary lazy evaluations

This commit is contained in:
Daniel Eades 2022-12-30 08:30:23 +00:00
parent 7530d76f00
commit cc80c5bd07
31 changed files with 50 additions and 51 deletions

View file

@ -253,7 +253,7 @@ fn generate_nodes(kinds: KindsSrc<'_>, grammar: &AstSrc) -> String {
matches!(kind, #(#kinds)|*)
}
fn cast(syntax: SyntaxNode) -> Option<Self> {
Self::can_cast(syntax.kind()).then(|| #name { syntax })
Self::can_cast(syntax.kind()).then_some(#name { syntax })
}
fn syntax(&self) -> &SyntaxNode {
&self.syntax