We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 634cfe3 commit 7025502Copy full SHA for 7025502
crates/syntax/src/tests/sourcegen_ast.rs
@@ -410,24 +410,17 @@ fn generate_syntax_kinds(grammar: KindsSrc<'_>) -> String {
410
411
impl SyntaxKind {
412
pub fn is_keyword(self) -> bool {
413
- match self {
414
- #(#all_keywords)|* => true,
415
- _ => false,
416
- }
+ matches!(self, #(#all_keywords)|*)
417
}
418
419
pub fn is_punct(self) -> bool {
420
421
- #(#punctuation)|* => true,
422
423
+
+ matches!(self, #(#punctuation)|*)
424
425
426
pub fn is_literal(self) -> bool {
427
428
- #(#literals)|* => true,
429
430
+ matches!(self, #(#literals)|*)
431
432
433
pub fn from_keyword(ident: &str) -> Option<SyntaxKind> {
0 commit comments