simplfy condition in ItemLowerer::with_trait_impl_ref()

This commit is contained in:
Matthias Krüger 2020-09-16 23:09:57 +02:00
parent 7bb106fe63
commit 94dae60040
1 changed files with 1 additions and 1 deletions

View File

@ -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;
}