From 81b637b6f2b410e81fb47919c8b3817979ec7073 Mon Sep 17 00:00:00 2001 From: klensy Date: Fri, 13 Jan 2023 17:54:16 +0300 Subject: [PATCH] fmt_type: don't alloc const String, use &str instead --- src/librustdoc/html/format.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/librustdoc/html/format.rs b/src/librustdoc/html/format.rs index 83fde5fd720..006076baf72 100644 --- a/src/librustdoc/html/format.rs +++ b/src/librustdoc/html/format.rs @@ -1055,7 +1055,7 @@ fn fmt_type<'cx>( _ => String::new(), }; let m = mutability.print_with_space(); - let amp = if f.alternate() { "&".to_string() } else { "&".to_string() }; + let amp = if f.alternate() { "&" } else { "&" }; match **ty { clean::DynTrait(ref bounds, ref trait_lt) if bounds.len() > 1 || trait_lt.is_some() =>