clippy: make generated code nice to read

Feel free to close if this is too minor.
This commit is contained in:
Kartavya Vashishtha 2022-08-07 17:09:36 +05:30
parent 634cfe3d72
commit 70255029cf
No known key found for this signature in database
GPG key ID: A50012C2324E5DF0

View file

@ -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> {