diff options
| author | Marek Barvíř <barvirm@gmail.com> | 2023-04-04 17:09:53 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-04-04 17:09:53 +0200 |
| commit | cfc671d82482f8e021fa966a01359abba0f53bd2 (patch) | |
| tree | 6a986dbe18160f8edadab53e49982c8a9b9598eb /src/syntax | |
| parent | 8aca3ca3c1af1ee4fc4ea22c2223aad37f7a83d2 (diff) | |
clippy::match_like_matches_macro (#502)
Diffstat (limited to 'src/syntax')
| -rw-r--r-- | src/syntax/ast.rs | 78 |
1 files changed, 39 insertions, 39 deletions
diff --git a/src/syntax/ast.rs b/src/syntax/ast.rs index d718ccf0..780c6164 100644 --- a/src/syntax/ast.rs +++ b/src/syntax/ast.rs @@ -316,49 +316,49 @@ impl AstNode for Expr { impl Expr { /// Can this expression be embedded into markup with a hashtag? pub fn hashtag(&self) -> bool { - match self { - Self::Ident(_) => true, - Self::None(_) => true, - Self::Auto(_) => true, - Self::Bool(_) => true, - Self::Int(_) => true, - Self::Float(_) => true, - Self::Numeric(_) => true, - Self::Str(_) => true, - Self::Code(_) => true, - Self::Content(_) => true, - Self::Array(_) => true, - Self::Dict(_) => true, - Self::Parenthesized(_) => true, - Self::FieldAccess(_) => true, - Self::FuncCall(_) => true, - Self::Let(_) => true, - Self::Set(_) => true, - Self::Show(_) => true, - Self::Conditional(_) => true, - Self::While(_) => true, - Self::For(_) => true, - Self::Import(_) => true, - Self::Include(_) => true, - Self::Break(_) => true, - Self::Continue(_) => true, - Self::Return(_) => true, - _ => false, - } + matches!( + self, + Self::Ident(_) + | Self::None(_) + | Self::Auto(_) + | Self::Bool(_) + | Self::Int(_) + | Self::Float(_) + | Self::Numeric(_) + | Self::Str(_) + | Self::Code(_) + | Self::Content(_) + | Self::Array(_) + | Self::Dict(_) + | Self::Parenthesized(_) + | Self::FieldAccess(_) + | Self::FuncCall(_) + | Self::Let(_) + | Self::Set(_) + | Self::Show(_) + | Self::Conditional(_) + | Self::While(_) + | Self::For(_) + | Self::Import(_) + | Self::Include(_) + | Self::Break(_) + | Self::Continue(_) + | Self::Return(_) + ) } /// Is this a literal? pub fn is_literal(&self) -> bool { - match self { - Self::None(_) => true, - Self::Auto(_) => true, - Self::Bool(_) => true, - Self::Int(_) => true, - Self::Float(_) => true, - Self::Numeric(_) => true, - Self::Str(_) => true, - _ => false, - } + matches!( + self, + Self::None(_) + | Self::Auto(_) + | Self::Bool(_) + | Self::Int(_) + | Self::Float(_) + | Self::Numeric(_) + | Self::Str(_) + ) } } |
