1
Fork 0

Rollup merge of #93634 - matthiaskrgr:clippy_complexity_jan_2022, r=oli-obk

compiler: clippy::complexity fixes

useless_format
map_flatten
useless_conversion
needless_bool
filter_next
clone_on_copy
needless_option_as_deref
This commit is contained in:
Matthias Krüger 2022-02-18 16:23:33 +01:00 committed by GitHub
commit a144ea1c4b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
22 changed files with 39 additions and 45 deletions

View file

@ -1437,8 +1437,7 @@ impl<'a, 'tcx> InferCtxtPrivExt<'a, 'tcx> for InferCtxt<'a, 'tcx> {
self.tcx
.associated_items(did)
.in_definition_order()
.filter(|assoc| assoc.ident(self.tcx) == trait_assoc_ident)
.next()
.find(|assoc| assoc.ident(self.tcx) == trait_assoc_ident)
},
)
})

View file

@ -959,7 +959,7 @@ fn opt_normalize_projection_type<'a, 'b, 'tcx>(
infcx.inner.borrow_mut().projection_cache().insert_term(cache_key, result.clone());
}
obligations.extend(result.obligations);
Ok(Some(result.value.into()))
Ok(Some(result.value))
}
Ok(Projected::NoProgress(projected_ty)) => {
let result = Normalized { value: projected_ty, obligations: vec![] };