Use Vec extend instead of repeated pushes in several places
This commit is contained in:
parent
e6b883c74f
commit
883d0a7aa5
5 changed files with 6 additions and 16 deletions
|
@ -686,9 +686,8 @@ fn bounds_from_generic_predicates<'tcx>(
|
|||
};
|
||||
let mut where_clauses = vec![];
|
||||
for (ty, bounds) in types {
|
||||
for bound in &bounds {
|
||||
where_clauses.push(format!("{}: {}", ty, tcx.def_path_str(*bound)));
|
||||
}
|
||||
where_clauses
|
||||
.extend(bounds.into_iter().map(|bound| format!("{}: {}", ty, tcx.def_path_str(bound))));
|
||||
}
|
||||
for projection in &projections {
|
||||
let p = projection.skip_binder();
|
||||
|
|
|
@ -904,10 +904,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
|||
) -> MigrationWarningReason {
|
||||
let mut reasons = MigrationWarningReason::default();
|
||||
|
||||
for auto_trait in auto_trait_reasons {
|
||||
reasons.auto_traits.push(auto_trait);
|
||||
}
|
||||
|
||||
reasons.auto_traits.extend(auto_trait_reasons);
|
||||
reasons.drop_order = drop_order;
|
||||
|
||||
reasons
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue