]> git.lizzy.rs Git - rust.git/commitdiff
Remove unneeded `to_string` call
authorGuillaume Gomez <guillaume.gomez@huawei.com>
Wed, 30 Mar 2022 19:13:15 +0000 (21:13 +0200)
committerGuillaume Gomez <guillaume.gomez@huawei.com>
Wed, 30 Mar 2022 19:13:15 +0000 (21:13 +0200)
src/librustdoc/html/render/print_item.rs

index 6c9a5a955d76ec3b4e5fa830a4bb0ee0831ec04e..1223b6c8002da0b4ed0ebc002c0f6691e11312f1 100644 (file)
@@ -465,7 +465,7 @@ fn tag_html(class: &str, title: &str, contents: &str) -> String {
 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();