diff --git a/src/librustdoc/clean/types.rs b/src/librustdoc/clean/types.rs
index edd3d77eeb78..86b952e1bf7f 100644
--- a/src/librustdoc/clean/types.rs
+++ b/src/librustdoc/clean/types.rs
@@ -1860,10 +1860,6 @@ impl PrimitiveType {
})
}
- crate fn to_url_str(&self) -> &'static str {
- self.as_str()
- }
-
crate fn as_sym(&self) -> Symbol {
use PrimitiveType::*;
match self {
diff --git a/src/librustdoc/html/format.rs b/src/librustdoc/html/format.rs
index fa57c9bda74d..e6e2f011906d 100644
--- a/src/librustdoc/html/format.rs
+++ b/src/librustdoc/html/format.rs
@@ -574,7 +574,7 @@ fn primitive_link(
f,
"",
"../".repeat(len),
- prim.to_url_str()
+ prim.as_str()
)?;
needs_termination = true;
}
@@ -603,7 +603,7 @@ fn primitive_link(
f,
"",
loc.join("/"),
- prim.to_url_str()
+ prim.as_str()
)?;
needs_termination = true;
}