about summary refs log tree commit diff
diff options
context:
space:
mode:
authorDylan DPC <99973273+Dylan-DPC@users.noreply.github.com>2022-03-31 13:09:54 +0200
committerGitHub <noreply@github.com>2022-03-31 13:09:54 +0200
commit57206d79d9043bf656ed10018143c5e863306f49 (patch)
tree0a11af331e39b9db3fede238f71d11a41bb78f65
parent4388ac58a2a1fc5d223563ea0c1fbf484d8f939f (diff)
parent8c0a8f5f89725aae216e7d5646729ed021b93149 (diff)
downloadrust-57206d79d9043bf656ed10018143c5e863306f49.tar.gz
rust-57206d79d9043bf656ed10018143c5e863306f49.zip
Rollup merge of #95495 - GuillaumeGomez:rm-unneeded-to-string, r=notriddle
Remove unneeded `to_string` call

Fixes a confusion I made when reading `@camelid's` comment [here](https://github.com/rust-lang/rust/pull/95096#discussion_r838851170).

r? `@notriddle`
-rw-r--r--src/librustdoc/html/render/print_item.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/librustdoc/html/render/print_item.rs b/src/librustdoc/html/render/print_item.rs
index 6c9a5a955d7..1223b6c8002 100644
--- a/src/librustdoc/html/render/print_item.rs
+++ b/src/librustdoc/html/render/print_item.rs
@@ -465,7 +465,7 @@ fn extra_info_tags(item: &clean::Item, parent: &clean::Item, tcx: TyCtxt<'_>) ->
 fn item_function(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, f: &clean::Function) {
     let header = it.fn_header(cx.tcx()).expect("printing a function which isn't a function");
     let constness = print_constness_with_space(&header.constness, it.const_stability(cx.tcx()));
-    let unsafety = header.unsafety.print_with_space().to_string();
+    let unsafety = header.unsafety.print_with_space();
     let abi = print_abi_with_space(header.abi).to_string();
     let asyncness = header.asyncness.print_with_space();
     let visibility = it.visibility.print_with_space(it.def_id, cx).to_string();