Rollup merge of #84466 - jyn514:prim-str, r=GuillaumeGomez
rustdoc: Remove `PrimitiveType::{to_url_str, as_str}` These can easily be rewritten in terms of `as_sym`, and this avoids bugs where the two get out of sync. I don't expect this to have a perf impact, but I'll start a perf run just in case.
This commit is contained in:
commit
74c744e54a
4 changed files with 10 additions and 45 deletions
|
@ -574,7 +574,7 @@ fn primitive_link(
|
|||
f,
|
||||
"<a class=\"primitive\" href=\"{}primitive.{}.html\">",
|
||||
"../".repeat(len),
|
||||
prim.to_url_str()
|
||||
prim.as_sym()
|
||||
)?;
|
||||
needs_termination = true;
|
||||
}
|
||||
|
@ -603,7 +603,7 @@ fn primitive_link(
|
|||
f,
|
||||
"<a class=\"primitive\" href=\"{}/primitive.{}.html\">",
|
||||
loc.join("/"),
|
||||
prim.to_url_str()
|
||||
prim.as_sym()
|
||||
)?;
|
||||
needs_termination = true;
|
||||
}
|
||||
|
@ -677,7 +677,7 @@ fn fmt_type<'cx>(
|
|||
fmt::Display::fmt(&tybounds(param_names, cx), f)
|
||||
}
|
||||
clean::Infer => write!(f, "_"),
|
||||
clean::Primitive(prim) => primitive_link(f, prim, prim.as_str(), cx),
|
||||
clean::Primitive(prim) => primitive_link(f, prim, &*prim.as_sym().as_str(), cx),
|
||||
clean::BareFunction(ref decl) => {
|
||||
if f.alternate() {
|
||||
write!(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue