diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2023-12-12 20:41:51 +0100 |
|---|---|---|
| committer | Matthias Krüger <matthias.krueger@famsik.de> | 2023-12-12 20:41:51 +0100 |
| commit | 3795cc8eb04b5b95c6a7a8dd7bcf357adb01169e (patch) | |
| tree | 8ccd1ba90842eddd34114fb1c37058950abcd91c /compiler/rustc_trait_selection/src/infer.rs | |
| parent | 27d8a577138c0d319a572cd1a464c2b755e577de (diff) | |
| download | rust-3795cc8eb04b5b95c6a7a8dd7bcf357adb01169e.tar.gz rust-3795cc8eb04b5b95c6a7a8dd7bcf357adb01169e.zip | |
more clippy::complexity fixes
redundant_guards
redundant_slicing
filter_next
needless_borrowed_reference
useless_format
Diffstat (limited to 'compiler/rustc_trait_selection/src/infer.rs')
| -rw-r--r-- | compiler/rustc_trait_selection/src/infer.rs | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/compiler/rustc_trait_selection/src/infer.rs b/compiler/rustc_trait_selection/src/infer.rs index 4b11cc3ace9..251f0628a71 100644 --- a/compiler/rustc_trait_selection/src/infer.rs +++ b/compiler/rustc_trait_selection/src/infer.rs @@ -101,11 +101,10 @@ impl<'tcx> InferCtxtExt<'tcx> for InferCtxt<'tcx> { self.tcx.impl_trait_ref(impl_def_id).map(|r| (impl_def_id, r)) }) .map(|(impl_def_id, imp)| (impl_def_id, imp.skip_binder())) - .filter(|(_, imp)| match imp.self_ty().peel_refs().kind() { + .find(|(_, imp)| match imp.self_ty().peel_refs().kind() { ty::Adt(i_def, _) if i_def.did() == def.did() => true, _ => false, }) - .next() { let mut fulfill_cx = FulfillmentCtxt::new(self); // We get all obligations from the impl to talk about specific |
