diff options
| author | Alexander Regueiro <alexreg@me.com> | 2019-09-06 22:38:07 +0100 | 
|---|---|---|
| committer | Alexander Regueiro <alexreg@me.com> | 2019-09-07 16:29:04 +0100 | 
| commit | 553a56dd98cee2e42fe8de0e3ad02a41a4a0eb13 (patch) | |
| tree | 92afc2f3bf4ccebb3b4cab330a93578163825a2e /src/libsyntax/parse/parser/expr.rs | |
| parent | 49d2fd1725510fd3bf6f2937e178b1aa055ddb02 (diff) | |
| download | rust-553a56dd98cee2e42fe8de0e3ad02a41a4a0eb13.tar.gz rust-553a56dd98cee2e42fe8de0e3ad02a41a4a0eb13.zip | |
Apply suggestions from code review
Diffstat (limited to 'src/libsyntax/parse/parser/expr.rs')
| -rw-r--r-- | src/libsyntax/parse/parser/expr.rs | 10 | 
1 files changed, 5 insertions, 5 deletions
| diff --git a/src/libsyntax/parse/parser/expr.rs b/src/libsyntax/parse/parser/expr.rs index f70c607198f..4dbb5ff75eb 100644 --- a/src/libsyntax/parse/parser/expr.rs +++ b/src/libsyntax/parse/parser/expr.rs @@ -843,7 +843,7 @@ impl<'a> Parser<'a> { return self.parse_block_expr(None, lo, BlockCheckMode::Default, attrs); } token::BinOp(token::Or) | token::OrOr => { - return self.parse_closure(attrs); + return self.parse_closure_expr(attrs); } token::OpenDelim(token::Bracket) => { self.bump(); @@ -919,7 +919,7 @@ impl<'a> Parser<'a> { return self.maybe_recover_from_bad_qpath(expr, true); } if self.check_keyword(kw::Move) || self.check_keyword(kw::Static) { - return self.parse_closure(attrs); + return self.parse_closure_expr(attrs); } if self.eat_keyword(kw::If) { return self.parse_if_expr(attrs); @@ -996,7 +996,7 @@ impl<'a> Parser<'a> { return if self.is_async_block() { // Check for `async {` and `async move {`. self.parse_async_block(attrs) } else { - self.parse_closure(attrs) + self.parse_closure_expr(attrs) }; } if self.eat_keyword(kw::Return) { @@ -1097,8 +1097,8 @@ impl<'a> Parser<'a> { Ok(self.mk_expr(blk.span, ExprKind::Block(blk, opt_label), attrs)) } - /// Parses a closure (e.g., `move |args| expr`). - fn parse_closure(&mut self, attrs: ThinVec<Attribute>) -> PResult<'a, P<Expr>> { + /// Parses a closure expression (e.g., `move |args| expr`). + fn parse_closure_expr(&mut self, attrs: ThinVec<Attribute>) -> PResult<'a, P<Expr>> { let lo = self.token.span; let movability = if self.eat_keyword(kw::Static) { | 
