Use Vec extend instead of repeated pushes in several places

This commit is contained in:
Jakub Beránek 2021-12-08 22:56:26 +01:00
parent e6b883c74f
commit 883d0a7aa5
No known key found for this signature in database
GPG key ID: DBC553E540C2F619
5 changed files with 6 additions and 16 deletions

View file

@ -498,9 +498,7 @@ fn orphan_check_trait_ref<'tcx>(
return Err(OrphanCheckErr::UncoveredTy(input_ty, local_type));
}
for input_ty in non_local_tys {
non_local_spans.push((input_ty, i == 0));
}
non_local_spans.extend(non_local_tys.into_iter().map(|input_ty| (input_ty, i == 0)));
}
// If we exit above loop, never found a local type.
debug!("orphan_check_trait_ref: no local type");