rustdoc: use collect()
instead of repeatedly pushing
#100157
Merged
collect()
instead of repeatedly pushing
#100157