about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJ. Ryan Stinnett <jryans@gmail.com>2021-01-03 17:32:48 +0000
committerJ. Ryan Stinnett <jryans@gmail.com>2021-01-08 07:15:03 +0000
commitea946071ddd5e0cf395eb910253bc1622dcd1f6c (patch)
tree630f38faf57f81c20b5e6342ef677b51faef39b0
parent8eaf68f92c213358dda59dc3eb648036ab62e18d (diff)
downloadrust-ea946071ddd5e0cf395eb910253bc1622dcd1f6c.tar.gz
rust-ea946071ddd5e0cf395eb910253bc1622dcd1f6c.zip
Combine several `push_str` calls
-rw-r--r--src/librustdoc/html/render/mod.rs7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/librustdoc/html/render/mod.rs b/src/librustdoc/html/render/mod.rs
index 754c954c3a7..e90e26f20e3 100644
--- a/src/librustdoc/html/render/mod.rs
+++ b/src/librustdoc/html/render/mod.rs
@@ -4426,13 +4426,12 @@ fn sidebar_deref_methods(cx: &Context<'_>, impl_: &Impl, v: &Vec<Impl>) -> Strin
                 let id = deref_id_map
                     .get(&real_target.def_id().unwrap())
                     .expect("Deref section without derived id");
-                out.push_str(&format!("<a class=\"sidebar-title\" href=\"#{}\">", id));
                 out.push_str(&format!(
-                    "Methods from {}&lt;Target={}&gt;",
+                    "<a class=\"sidebar-title\" href=\"#{}\">Methods from {}&lt;Target={}&gt;</a>",
+                    id,
                     Escape(&format!("{:#}", impl_.inner_impl().trait_.as_ref().unwrap().print())),
-                    Escape(&format!("{:#}", real_target.print()))
+                    Escape(&format!("{:#}", real_target.print())),
                 ));
-                out.push_str("</a>");
                 // We want links' order to be reproducible so we don't use unstable sort.
                 ret.sort();
                 out.push_str(&format!("<div class=\"sidebar-links\">{}</div>", ret.join("")));