Skip to content

Commit 1c583c0

Browse files
committed
Simplify the boolean logic in a closure.
And rename a closure argument.
1 parent 8e7fd55 commit 1c583c0

File tree

1 file changed

+1
-6
lines changed
  • compiler/rustc_trait_selection/src/traits

1 file changed

+1
-6
lines changed

compiler/rustc_trait_selection/src/traits/project.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1230,12 +1230,7 @@ fn opt_normalize_projection_type<'a, 'b, 'tcx>(
12301230
};
12311231

12321232
let mut deduped: SsoHashSet<_> = Default::default();
1233-
result.obligations.retain(|projected_obligation| {
1234-
if !deduped.insert(projected_obligation.clone()) {
1235-
return false;
1236-
}
1237-
true
1238-
});
1233+
result.obligations.retain(|obligation| deduped.insert(obligation.clone()));
12391234

12401235
if use_cache {
12411236
infcx.inner.borrow_mut().projection_cache().insert_term(cache_key, result.clone());

0 commit comments

Comments
 (0)