Skip to content

Commit 81b637b

Browse files
committed
fmt_type: don't alloc const String, use &str instead
1 parent cda6efe commit 81b637b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/librustdoc/html/format.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1055,7 +1055,7 @@ fn fmt_type<'cx>(
10551055
_ => String::new(),
10561056
};
10571057
let m = mutability.print_with_space();
1058-
let amp = if f.alternate() { "&".to_string() } else { "&amp;".to_string() };
1058+
let amp = if f.alternate() { "&" } else { "&amp;" };
10591059
match **ty {
10601060
clean::DynTrait(ref bounds, ref trait_lt)
10611061
if bounds.len() > 1 || trait_lt.is_some() =>

0 commit comments

Comments
 (0)