about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--crates/ra_parser/src/grammar/expressions.rs6
1 files changed, 2 insertions, 4 deletions
diff --git a/crates/ra_parser/src/grammar/expressions.rs b/crates/ra_parser/src/grammar/expressions.rs
index d6e8df32a14..6e72eea6646 100644
--- a/crates/ra_parser/src/grammar/expressions.rs
+++ b/crates/ra_parser/src/grammar/expressions.rs
@@ -50,10 +50,8 @@ fn expr_no_struct(p: &mut Parser) {
 }
 
 fn is_expr_stmt_attr_allowed(kind: SyntaxKind) -> bool {
-    match kind {
-        BIN_EXPR | RANGE_EXPR | IF_EXPR => false,
-        _ => true,
-    }
+    let forbid = matches!(kind, BIN_EXPR | RANGE_EXPR);
+    !forbid
 }
 
 pub(super) fn stmt(p: &mut Parser, with_semi: StmtWithSemi) {