about summary refs log tree commit diff
path: root/crates/parser/src
diff options
context:
space:
mode:
authorbellau <laurent.belmonte@gmail.com>2022-02-14 07:41:50 +0100
committerbellau <laurent.belmonte@gmail.com>2022-02-14 07:41:50 +0100
commit06452cd102dc78df4e26eeacfb8d0e3cf8a2b711 (patch)
treeff9d360a6cf97cf7c48d7d4781ca35e4c0a417af /crates/parser/src
parentdc68b894692d309e71d9b639ac6325a9d1cb67e0 (diff)
downloadrust-06452cd102dc78df4e26eeacfb8d0e3cf8a2b711.tar.gz
rust-06452cd102dc78df4e26eeacfb8d0e3cf8a2b711.zip
Fix style
Diffstat (limited to 'crates/parser/src')
-rw-r--r--crates/parser/src/grammar/expressions/atom.rs12
-rw-r--r--crates/parser/src/grammar/items.rs2
2 files changed, 5 insertions, 9 deletions
diff --git a/crates/parser/src/grammar/expressions/atom.rs b/crates/parser/src/grammar/expressions/atom.rs
index 53dbbfea754..4b7a1b31fbd 100644
--- a/crates/parser/src/grammar/expressions/atom.rs
+++ b/crates/parser/src/grammar/expressions/atom.rs
@@ -72,14 +72,10 @@ pub(super) fn atom_expr(p: &mut Parser, r: Restrictions) -> Option<(CompletedMar
         T!['('] => tuple_expr(p),
         T!['['] => array_expr(p),
         T![|] => closure_expr(p),
-        T![move] if la == T![|] => closure_expr(p),
-        T![async] if la == T![|] || (la == T![move] && p.nth(2) == T![|]) => closure_expr(p),
-        T![static]
-            if la == T![|]
-                || (la == T![move] && p.nth(2) == T![|])
-                || (la == T![async] && p.nth(2) == T![|])
-                || (la == T![async] && p.nth(2) == T![move] && p.nth(3) == T![|]) =>
-        {
+        T![static] | T![async] | T![move] if la == T![|] => closure_expr(p),
+        T![static] | T![async] if la == T![move] && p.nth(2) == T![|] => closure_expr(p),
+        T![static] if la == T![async] && p.nth(2) == T![|] => closure_expr(p),
+        T![static] if la == T![async] && p.nth(2) == T![move] && p.nth(3) == T![|] => {
             closure_expr(p)
         }
         T![if] => if_expr(p),
diff --git a/crates/parser/src/grammar/items.rs b/crates/parser/src/grammar/items.rs
index c9e5d42392e..36d13cc9773 100644
--- a/crates/parser/src/grammar/items.rs
+++ b/crates/parser/src/grammar/items.rs
@@ -230,7 +230,7 @@ fn opt_item_without_modifiers(p: &mut Parser, m: Marker) -> Result<(), Marker> {
         IDENT if p.at_contextual_kw(T![macro_rules]) && p.nth(1) == BANG => macro_rules(p, m),
 
         T![const] if (la == IDENT || la == T![_] || la == T![mut]) => consts::konst(p, m),
-        T![static] if (la != PIPE && la != T![move] && la != T![async]) => consts::static_(p, m),
+        T![static] if (la == IDENT || la == T![_] || la == T![mut]) => consts::static_(p, m),
 
         _ => return Err(m),
     };