Skip to content

Commit 00bc134

Browse files
committed
remove unneccessary wrapping of return value in mk_await_expr()
1 parent 12080dc commit 00bc134

File tree

1 file changed

+3
-3
lines changed
  • compiler/rustc_parse/src/parser

1 file changed

+3
-3
lines changed

compiler/rustc_parse/src/parser/expr.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1041,7 +1041,7 @@ impl<'a> Parser<'a> {
10411041
/// Assuming we have just parsed `.`, continue parsing into an expression.
10421042
fn parse_dot_suffix(&mut self, self_arg: P<Expr>, lo: Span) -> PResult<'a, P<Expr>> {
10431043
if self.token.uninterpolated_span().rust_2018() && self.eat_keyword(kw::Await) {
1044-
return self.mk_await_expr(self_arg, lo);
1044+
return Ok(self.mk_await_expr(self_arg, lo));
10451045
}
10461046

10471047
let fn_span_lo = self.token.span;
@@ -2421,11 +2421,11 @@ impl<'a> Parser<'a> {
24212421
ExprKind::Call(f, args)
24222422
}
24232423

2424-
fn mk_await_expr(&mut self, self_arg: P<Expr>, lo: Span) -> PResult<'a, P<Expr>> {
2424+
fn mk_await_expr(&mut self, self_arg: P<Expr>, lo: Span) -> P<Expr> {
24252425
let span = lo.to(self.prev_token.span);
24262426
let await_expr = self.mk_expr(span, ExprKind::Await(self_arg), AttrVec::new());
24272427
self.recover_from_await_method_call();
2428-
Ok(await_expr)
2428+
await_expr
24292429
}
24302430

24312431
crate fn mk_expr(&self, span: Span, kind: ExprKind, attrs: AttrVec) -> P<Expr> {

0 commit comments

Comments
 (0)