diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2020-09-16 23:09:57 +0200 |
|---|---|---|
| committer | Matthias Krüger <matthias.krueger@famsik.de> | 2020-09-16 23:09:57 +0200 |
| commit | 94dae6004035c356b00dac8764c1b4808d740928 (patch) | |
| tree | c5c29396969c572261d2b22a01e106b68d84accc | |
| parent | 7bb106fe633872de703af46381843057f8cd384f (diff) | |
| download | rust-94dae6004035c356b00dac8764c1b4808d740928.tar.gz rust-94dae6004035c356b00dac8764c1b4808d740928.zip | |
simplfy condition in ItemLowerer::with_trait_impl_ref()
| -rw-r--r-- | compiler/rustc_ast_lowering/src/item.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_ast_lowering/src/item.rs b/compiler/rustc_ast_lowering/src/item.rs index 6d41b7836b1..617cacee0e7 100644 --- a/compiler/rustc_ast_lowering/src/item.rs +++ b/compiler/rustc_ast_lowering/src/item.rs @@ -27,7 +27,7 @@ pub(super) struct ItemLowerer<'a, 'lowering, 'hir> { impl ItemLowerer<'_, '_, '_> { fn with_trait_impl_ref(&mut self, impl_ref: &Option<TraitRef>, f: impl FnOnce(&mut Self)) { let old = self.lctx.is_in_trait_impl; - self.lctx.is_in_trait_impl = if let &None = impl_ref { false } else { true }; + self.lctx.is_in_trait_impl = impl_ref.is_some(); f(self); self.lctx.is_in_trait_impl = old; } |
