simplify 'let question = ...;'

This commit is contained in:
Mazdak Farrokhzad 2019-12-08 11:57:18 +01:00
parent f215ca9be6
commit 4625ba4872

View File

@ -426,7 +426,7 @@ fn parse_generic_bound(
let has_parens = self.eat(&token::OpenDelim(token::Paren));
let inner_lo = self.token.span;
let is_negative = self.eat(&token::Not);
let question = if self.eat(&token::Question) { Some(self.prev_span) } else { None };
let question = self.eat(&token::Question).then_some(self.prev_span);
if self.token.is_lifetime() {
Ok(Ok(self.parse_generic_lt_bound(lo, inner_lo, has_parens, question)?))
} else {