diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2023-08-08 14:22:34 +1000 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2023-08-08 15:38:20 +1000 |
| commit | 1c583c0b914eb46164f233f9ba2d0d351e64da1f (patch) | |
| tree | 681560af25cc086066bd94a40967f75af20ba6c3 | |
| parent | 8e7fd551311d424e4e63fa45906a2a928fce96a7 (diff) | |
| download | rust-1c583c0b914eb46164f233f9ba2d0d351e64da1f.tar.gz rust-1c583c0b914eb46164f233f9ba2d0d351e64da1f.zip | |
Simplify the boolean logic in a closure.
And rename a closure argument.
| -rw-r--r-- | compiler/rustc_trait_selection/src/traits/project.rs | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/compiler/rustc_trait_selection/src/traits/project.rs b/compiler/rustc_trait_selection/src/traits/project.rs index 3d800421b76..4b13abb8790 100644 --- a/compiler/rustc_trait_selection/src/traits/project.rs +++ b/compiler/rustc_trait_selection/src/traits/project.rs @@ -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()); |
