Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 765df3a

Browse files
committedDec 20, 2019
simplify 'let question = ...;'
1 parent 90f7d8b commit 765df3a

File tree

1 file changed

+1
-1
lines changed
  • src/librustc_parse/parser

1 file changed

+1
-1
lines changed
 

‎src/librustc_parse/parser/ty.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ impl<'a> Parser<'a> {
426426
let has_parens = self.eat(&token::OpenDelim(token::Paren));
427427
let inner_lo = self.token.span;
428428
let is_negative = self.eat(&token::Not);
429-
let question = if self.eat(&token::Question) { Some(self.prev_span) } else { None };
429+
let question = self.eat(&token::Question).then_some(self.prev_span);
430430
if self.token.is_lifetime() {
431431
Ok(Ok(self.parse_generic_lt_bound(lo, inner_lo, has_parens, question)?))
432432
} else {

0 commit comments

Comments
 (0)
Please sign in to comment.