Fix style

This commit is contained in:
bellau 2022-02-14 07:41:50 +01:00
parent dc68b89469
commit 06452cd102
2 changed files with 5 additions and 9 deletions

View file

@ -72,14 +72,10 @@ pub(super) fn atom_expr(p: &mut Parser, r: Restrictions) -> Option<(CompletedMar
T!['('] => tuple_expr(p), T!['('] => tuple_expr(p),
T!['['] => array_expr(p), T!['['] => array_expr(p),
T![|] => closure_expr(p), T![|] => closure_expr(p),
T![move] if la == T![|] => closure_expr(p), T![static] | T![async] | 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] | T![async] if la == T![move] && p.nth(2) == T![|] => closure_expr(p),
T![static] T![static] if la == T![async] && p.nth(2) == T![|] => closure_expr(p),
if la == T![|] T![static] if la == T![async] && p.nth(2) == T![move] && p.nth(3) == 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![|]) =>
{
closure_expr(p) closure_expr(p)
} }
T![if] => if_expr(p), T![if] => if_expr(p),

View file

@ -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), 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![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), _ => return Err(m),
}; };