Skip to content

Commit b680b66

Browse files
committed
parse_bottom_expr: extract common 'return' out.
1 parent 9b4a630 commit b680b66

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/libsyntax/parse/parser.rs

+5-6
Original file line numberDiff line numberDiff line change
@@ -2643,13 +2643,12 @@ impl<'a> Parser<'a> {
26432643
hi = path.span;
26442644
return Ok(self.mk_expr(lo.to(hi), ExprKind::Path(Some(qself), path), attrs));
26452645
}
2646-
if self.span.rust_2018() && self.check_keyword(keywords::Async)
2647-
{
2648-
if self.is_async_block() { // check for `async {` and `async move {`
2649-
return self.parse_async_block(attrs);
2646+
if self.span.rust_2018() && self.check_keyword(keywords::Async) {
2647+
return if self.is_async_block() { // check for `async {` and `async move {`
2648+
self.parse_async_block(attrs)
26502649
} else {
2651-
return self.parse_lambda_expr(attrs);
2652-
}
2650+
self.parse_lambda_expr(attrs)
2651+
};
26532652
}
26542653
if self.check_keyword(keywords::Move) || self.check_keyword(keywords::Static) {
26552654
return self.parse_lambda_expr(attrs);

0 commit comments

Comments
 (0)