Skip to content

Commit 7025502

Browse files
committed
clippy: make generated code nice to read
Feel free to close if this is too minor.
1 parent 634cfe3 commit 7025502

File tree

1 file changed

+5
-12
lines changed

1 file changed

+5
-12
lines changed

crates/syntax/src/tests/sourcegen_ast.rs

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -410,24 +410,17 @@ fn generate_syntax_kinds(grammar: KindsSrc<'_>) -> String {
410410

411411
impl SyntaxKind {
412412
pub fn is_keyword(self) -> bool {
413-
match self {
414-
#(#all_keywords)|* => true,
415-
_ => false,
416-
}
413+
matches!(self, #(#all_keywords)|*)
417414
}
418415

419416
pub fn is_punct(self) -> bool {
420-
match self {
421-
#(#punctuation)|* => true,
422-
_ => false,
423-
}
417+
418+
matches!(self, #(#punctuation)|*)
419+
424420
}
425421

426422
pub fn is_literal(self) -> bool {
427-
match self {
428-
#(#literals)|* => true,
429-
_ => false,
430-
}
423+
matches!(self, #(#literals)|*)
431424
}
432425

433426
pub fn from_keyword(ident: &str) -> Option<SyntaxKind> {

0 commit comments

Comments
 (0)