diff options
| author | Mazdak Farrokhzad <twingoow@gmail.com> | 2019-12-08 11:57:18 +0100 |
|---|---|---|
| committer | Mazdak Farrokhzad <twingoow@gmail.com> | 2019-12-21 19:20:41 +0100 |
| commit | 4625ba4872e17a98ea11940fff0e50b3b880b815 (patch) | |
| tree | 81f2e20669c7419f7c518277c758e2e92320dcab /src | |
| parent | f215ca9be63ad7d7b916115e729bacf927621cb8 (diff) | |
| download | rust-4625ba4872e17a98ea11940fff0e50b3b880b815.tar.gz rust-4625ba4872e17a98ea11940fff0e50b3b880b815.zip | |
simplify 'let question = ...;'
Diffstat (limited to 'src')
| -rw-r--r-- | src/librustc_parse/parser/ty.rs | 2 |
1 files changed, 1 insertions, 1 deletions
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 @@ impl<'a> Parser<'a> { 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 { |
