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
5 changed files with 6 additions and 16 deletions

View File

@@ -362,9 +362,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
.infcx
.probe(|_| self.match_projection_obligation_against_definition_bounds(obligation));
for predicate_index in result {
candidates.vec.push(ProjectionCandidate(predicate_index));
}
candidates.vec.extend(result.into_iter().map(ProjectionCandidate));
}
/// Given an obligation like `<SomeTrait for T>`, searches the obligations that the caller