Simplify the boolean logic in a closure.
And rename a closure argument.
This commit is contained in:
parent
8e7fd55131
commit
1c583c0b91
@ -1230,12 +1230,7 @@ fn opt_normalize_projection_type<'a, 'b, 'tcx>(
|
|||||||
};
|
};
|
||||||
|
|
||||||
let mut deduped: SsoHashSet<_> = Default::default();
|
let mut deduped: SsoHashSet<_> = Default::default();
|
||||||
result.obligations.retain(|projected_obligation| {
|
result.obligations.retain(|obligation| deduped.insert(obligation.clone()));
|
||||||
if !deduped.insert(projected_obligation.clone()) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
true
|
|
||||||
});
|
|
||||||
|
|
||||||
if use_cache {
|
if use_cache {
|
||||||
infcx.inner.borrow_mut().projection_cache().insert_term(cache_key, result.clone());
|
infcx.inner.borrow_mut().projection_cache().insert_term(cache_key, result.clone());
|
||||||
|
Loading…
Reference in New Issue
Block a user