Skip to content

Commit 141c542

Browse files
committed
Remove String allocation in loop
1 parent 51e8031 commit 141c542

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/librustdoc/html/format.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,7 @@ crate fn print_generic_bounds<'a, 'tcx: 'a>(
141141
display_fn(move |f| {
142142
let mut bounds_dup = FxHashSet::default();
143143

144-
for (i, bound) in
145-
bounds.iter().filter(|b| bounds_dup.insert(b.print(cx).to_string())).enumerate()
146-
{
144+
for (i, bound) in bounds.iter().filter(|b| bounds_dup.insert(b.clone())).enumerate() {
147145
if i > 0 {
148146
f.write_str(" + ")?;
149147
}

0 commit comments

Comments
 (0)