1
Fork 0

more clippy::complexity fixes

redundant_guards
      redundant_slicing
      filter_next
      needless_borrowed_reference
      useless_format
This commit is contained in:
Matthias Krüger 2023-12-12 20:41:51 +01:00
parent 27d8a57713
commit 3795cc8eb0
10 changed files with 18 additions and 28 deletions

View file

@ -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