Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/syntax/src/tests/sourcegen_ast.rs')
-rw-r--r--crates/syntax/src/tests/sourcegen_ast.rs12
1 files changed, 5 insertions, 7 deletions
diff --git a/crates/syntax/src/tests/sourcegen_ast.rs b/crates/syntax/src/tests/sourcegen_ast.rs
index 71171c859b..08700cd5a8 100644
--- a/crates/syntax/src/tests/sourcegen_ast.rs
+++ b/crates/syntax/src/tests/sourcegen_ast.rs
@@ -250,13 +250,11 @@ fn generate_nodes(kinds: KindsSrc<'_>, grammar: &AstSrc) -> String {
}
}
fn cast(syntax: SyntaxNode) -> Option<Self> {
- let res = match syntax.kind() {
- #(
- #kinds => #name { syntax },
- )*
- _ => return None,
- };
- Some(res)
+ match syntax.kind() {
+ #(#kinds)|* => Some(#name { syntax }),
+ _ => None,
+ }
+
}
fn syntax(&self) -> &SyntaxNode {
&self.syntax