Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 45cd187

Browse files
committed
revert part that causes perf regression
1 parent e9ff343 commit 45cd187

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/librustdoc/html/format.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,12 @@ pub(crate) enum HrefError {
495495
// Panics if `syms` is empty.
496496
pub(crate) fn join_with_double_colon(syms: &[Symbol]) -> String {
497497
let mut s = String::with_capacity(estimate_item_path_byte_length(syms.len()));
498-
write!(s, "{}", fmt::from_fn(|f| syms.iter().joined("::", f))).unwrap();
498+
// NOTE: using `Joined::joined` here causes a noticeable perf regression
499+
s.push_str(syms[0].as_str());
500+
for sym in &syms[1..] {
501+
s.push_str("::");
502+
s.push_str(sym.as_str());
503+
}
499504
s
500505
}
501506

0 commit comments

Comments
 (0)