fmt_type: don't alloc const String, use &str instead

This commit is contained in:
klensy 2023-01-13 17:54:16 +03:00
parent cda6efeeb8
commit 81b637b6f2

View File

@ -1055,7 +1055,7 @@ fn fmt_type<'cx>(
_ => String::new(),
};
let m = mutability.print_with_space();
let amp = if f.alternate() { "&".to_string() } else { "&amp;".to_string() };
let amp = if f.alternate() { "&" } else { "&amp;" };
match **ty {
clean::DynTrait(ref bounds, ref trait_lt)
if bounds.len() > 1 || trait_lt.is_some() =>