]> git.lizzy.rs Git - rust.git/blobdiff - crates/parser/src/grammar/expressions/atom.rs
parameters.split_last()
[rust.git] / crates / parser / src / grammar / expressions / atom.rs
index b4d88f8d0ed903effc84a48847638732fe7cc2c1..4b7a1b31fbdfc6ee78df6ee330ef73515f0453bd 100644 (file)
@@ -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),
@@ -271,7 +267,6 @@ fn closure_expr(p: &mut Parser) -> CompletedMarker {
         // fn main() { || -> i32 { 92 }(); }
         block_expr(p);
     } else if p.at_ts(EXPR_FIRST) {
-        println!("gg");
         expr(p);
     } else {
         p.error("expected expression");