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:
commit
a144ea1c4b
22 changed files with 39 additions and 45 deletions
|
@ -198,7 +198,7 @@ fn deprecation_message(
|
|||
} else {
|
||||
let since = since.as_ref().map(Symbol::as_str);
|
||||
|
||||
if since.as_deref() == Some("TBD") {
|
||||
if since == Some("TBD") {
|
||||
format!("use of {} `{}` that will be deprecated in a future Rust version", kind, path)
|
||||
} else {
|
||||
format!(
|
||||
|
|
|
@ -855,7 +855,7 @@ impl<'tcx> Relate<'tcx> for ty::ProjectionPredicate<'tcx> {
|
|||
) -> RelateResult<'tcx, ty::ProjectionPredicate<'tcx>> {
|
||||
Ok(ty::ProjectionPredicate {
|
||||
projection_ty: relation.relate(a.projection_ty, b.projection_ty)?,
|
||||
term: relation.relate(a.term, b.term)?.into(),
|
||||
term: relation.relate(a.term, b.term)?,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
@ -210,7 +210,7 @@ impl<'tcx> TyCtxt<'tcx> {
|
|||
pub fn all_impls(self, def_id: DefId) -> impl Iterator<Item = DefId> + 'tcx {
|
||||
let TraitImpls { blanket_impls, non_blanket_impls } = self.trait_impls_of(def_id);
|
||||
|
||||
blanket_impls.iter().chain(non_blanket_impls.iter().map(|(_, v)| v).flatten()).cloned()
|
||||
blanket_impls.iter().chain(non_blanket_impls.iter().flat_map(|(_, v)| v)).cloned()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue