Skip to content

Commit 7ba51fa

Browse files
committed
rustdoc: use collect() instead of repeatedly pushing to bindings
1 parent f6f9d5e commit 7ba51fa

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/librustdoc/clean/mod.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -1640,9 +1640,9 @@ pub(crate) fn clean_middle_ty<'tcx>(
16401640
bounds.push(bound);
16411641
}
16421642

1643-
let mut bindings = vec![];
1644-
for pb in obj.projection_bounds() {
1645-
bindings.push(TypeBinding {
1643+
let bindings = obj
1644+
.projection_bounds()
1645+
.map(|pb| TypeBinding {
16461646
assoc: projection_to_path_segment(
16471647
pb.skip_binder()
16481648
.lift_to_tcx(cx.tcx)
@@ -1656,8 +1656,8 @@ pub(crate) fn clean_middle_ty<'tcx>(
16561656
kind: TypeBindingKind::Equality {
16571657
term: clean_middle_term(pb.skip_binder().term, cx),
16581658
},
1659-
});
1660-
}
1659+
})
1660+
.collect();
16611661

16621662
let path = external_path(cx, did, false, bindings, substs);
16631663
bounds.insert(0, PolyTrait { trait_: path, generic_params: Vec::new() });

0 commit comments

Comments
 (0)