]> 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 53dbbfea7549372138cda855dd71ed1ef2c45e20..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),