summaryrefslogtreecommitdiff
path: root/src/syntax
diff options
context:
space:
mode:
Diffstat (limited to 'src/syntax')
-rw-r--r--src/syntax/ast.rs78
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(_)
+ )
}
}