Unnamed repository; edit this file 'description' to name the repository.
clippy: make generated code nice to read
Feel free to close if this is too minor.
Kartavya Vashishtha 2022-08-07
parent 634cfe3 · commit 7025502
-rw-r--r--crates/syntax/src/tests/sourcegen_ast.rs17
1 files changed, 5 insertions, 12 deletions
diff --git a/crates/syntax/src/tests/sourcegen_ast.rs b/crates/syntax/src/tests/sourcegen_ast.rs
index 6d27662251..daad939f82 100644
--- a/crates/syntax/src/tests/sourcegen_ast.rs
+++ b/crates/syntax/src/tests/sourcegen_ast.rs
@@ -410,24 +410,17 @@ fn generate_syntax_kinds(grammar: KindsSrc<'_>) -> String {
impl SyntaxKind {
pub fn is_keyword(self) -> bool {
- match self {
- #(#all_keywords)|* => true,
- _ => false,
- }
+ matches!(self, #(#all_keywords)|*)
}
pub fn is_punct(self) -> bool {
- match self {
- #(#punctuation)|* => true,
- _ => false,
- }
+
+ matches!(self, #(#punctuation)|*)
+
}
pub fn is_literal(self) -> bool {
- match self {
- #(#literals)|* => true,
- _ => false,
- }
+ matches!(self, #(#literals)|*)
}
pub fn from_keyword(ident: &str) -> Option<SyntaxKind> {