From 4625ba4872e17a98ea11940fff0e50b3b880b815 Mon Sep 17 00:00:00 2001 From: Mazdak Farrokhzad Date: Sun, 8 Dec 2019 11:57:18 +0100 Subject: [PATCH] simplify 'let question = ...;' --- src/librustc_parse/parser/ty.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/librustc_parse/parser/ty.rs b/src/librustc_parse/parser/ty.rs index eadaf8ad716..c9722045875 100644 --- a/src/librustc_parse/parser/ty.rs +++ b/src/librustc_parse/parser/ty.rs @@ -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 {