diff options
author | Clemens Wasser <[email protected]> | 2021-06-03 10:45:10 +0100 |
---|---|---|
committer | Clemens Wasser <[email protected]> | 2021-06-03 10:46:03 +0100 |
commit | 3c6dc0f89dc9c2902d71e8639b4913917a396f8a (patch) | |
tree | 6a1acfe280a8e9369a753b4e7bb829b8b9ff6317 /xtask | |
parent | e8e14e1b13b76aaa643bc3beffb9c52bc5228d24 (diff) |
Apply a few clippy suggestions
Diffstat (limited to 'xtask')
-rw-r--r-- | xtask/src/codegen/gen_syntax.rs | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/xtask/src/codegen/gen_syntax.rs b/xtask/src/codegen/gen_syntax.rs index ba4b24848..b0b9e30db 100644 --- a/xtask/src/codegen/gen_syntax.rs +++ b/xtask/src/codegen/gen_syntax.rs | |||
@@ -94,18 +94,16 @@ fn generate_nodes(kinds: KindsSrc<'_>, grammar: &AstSrc) -> Result<String> { | |||
94 | support::children(&self.syntax) | 94 | support::children(&self.syntax) |
95 | } | 95 | } |
96 | } | 96 | } |
97 | } else { | 97 | } else if let Some(token_kind) = field.token_kind() { |
98 | if let Some(token_kind) = field.token_kind() { | 98 | quote! { |
99 | quote! { | 99 | pub fn #method_name(&self) -> Option<#ty> { |
100 | pub fn #method_name(&self) -> Option<#ty> { | 100 | support::token(&self.syntax, #token_kind) |
101 | support::token(&self.syntax, #token_kind) | ||
102 | } | ||
103 | } | 101 | } |
104 | } else { | 102 | } |
105 | quote! { | 103 | } else { |
106 | pub fn #method_name(&self) -> Option<#ty> { | 104 | quote! { |
107 | support::child(&self.syntax) | 105 | pub fn #method_name(&self) -> Option<#ty> { |
108 | } | 106 | support::child(&self.syntax) |
109 | } | 107 | } |
110 | } | 108 | } |
111 | } | 109 | } |