parse_bottom_expr: extract common 'return' out.
This commit is contained in:
parent
9b4a630baa
commit
b680b66ddd
1 changed files with 5 additions and 6 deletions
|
@ -2643,13 +2643,12 @@ impl<'a> Parser<'a> {
|
||||||
hi = path.span;
|
hi = path.span;
|
||||||
return Ok(self.mk_expr(lo.to(hi), ExprKind::Path(Some(qself), path), attrs));
|
return Ok(self.mk_expr(lo.to(hi), ExprKind::Path(Some(qself), path), attrs));
|
||||||
}
|
}
|
||||||
if self.span.rust_2018() && self.check_keyword(keywords::Async)
|
if self.span.rust_2018() && self.check_keyword(keywords::Async) {
|
||||||
{
|
return if self.is_async_block() { // check for `async {` and `async move {`
|
||||||
if self.is_async_block() { // check for `async {` and `async move {`
|
self.parse_async_block(attrs)
|
||||||
return self.parse_async_block(attrs);
|
|
||||||
} else {
|
} else {
|
||||||
return self.parse_lambda_expr(attrs);
|
self.parse_lambda_expr(attrs)
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
if self.check_keyword(keywords::Move) || self.check_keyword(keywords::Static) {
|
if self.check_keyword(keywords::Move) || self.check_keyword(keywords::Static) {
|
||||||
return self.parse_lambda_expr(attrs);
|
return self.parse_lambda_expr(attrs);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue