Skip to content

Commit 4625ba4

Browse files
committed
simplify 'let question = ...;'
1 parent f215ca9 commit 4625ba4

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)