Simplify the boolean logic in a closure.

And rename a closure argument.
This commit is contained in:
Nicholas Nethercote 2023-08-08 14:22:34 +10:00
parent 8e7fd55131
commit 1c583c0b91

View File

@ -1230,12 +1230,7 @@ fn opt_normalize_projection_type<'a, 'b, 'tcx>(
};
let mut deduped: SsoHashSet<_> = Default::default();
result.obligations.retain(|projected_obligation| {
if !deduped.insert(projected_obligation.clone()) {
return false;
}
true
});
result.obligations.retain(|obligation| deduped.insert(obligation.clone()));
if use_cache {
infcx.inner.borrow_mut().projection_cache().insert_term(cache_key, result.clone());