Skip to content

Commit

Permalink
Combine several push_str calls
Browse files Browse the repository at this point in the history
  • Loading branch information
jryans committed Jan 8, 2021
1 parent 8eaf68f commit ea94607
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/librustdoc/html/render/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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("")));
Expand Down

0 comments on commit ea94607

Please sign in to comment.