Apply a few clippy suggestions

This commit is contained in:
Clemens Wasser 2021-06-03 11:45:10 +02:00
parent e8e14e1b13
commit 3c6dc0f89d
4 changed files with 121 additions and 47 deletions

View file

@ -94,18 +94,16 @@ fn generate_nodes(kinds: KindsSrc<'_>, grammar: &AstSrc) -> Result<String> {
support::children(&self.syntax)
}
}
} else {
if let Some(token_kind) = field.token_kind() {
quote! {
pub fn #method_name(&self) -> Option<#ty> {
support::token(&self.syntax, #token_kind)
}
} else if let Some(token_kind) = field.token_kind() {
quote! {
pub fn #method_name(&self) -> Option<#ty> {
support::token(&self.syntax, #token_kind)
}
} else {
quote! {
pub fn #method_name(&self) -> Option<#ty> {
support::child(&self.syntax)
}
}
} else {
quote! {
pub fn #method_name(&self) -> Option<#ty> {
support::child(&self.syntax)
}
}
}