Skip to content

Commit 735a25a

Browse files
committed
Rename method 'to_string' to match conventions.
1 parent aee0eba commit 735a25a

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/librustdoc/clean/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1571,7 +1571,7 @@ impl PrimitiveType {
15711571
None
15721572
}
15731573

1574-
pub fn to_string(&self) -> &'static str {
1574+
pub fn as_str(&self) -> &'static str {
15751575
match *self {
15761576
PrimitiveType::Isize => "isize",
15771577
PrimitiveType::I8 => "i8",
@@ -1596,7 +1596,7 @@ impl PrimitiveType {
15961596
}
15971597

15981598
pub fn to_url_str(&self) -> &'static str {
1599-
self.to_string()
1599+
self.as_str()
16001600
}
16011601

16021602
/// Creates a rustdoc-specific node id for primitive types.

src/librustdoc/html/format.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,7 @@ impl fmt::Display for clean::Type {
457457
tybounds(f, typarams)
458458
}
459459
clean::Infer => write!(f, "_"),
460-
clean::Primitive(prim) => primitive_link(f, prim, prim.to_string()),
460+
clean::Primitive(prim) => primitive_link(f, prim, prim.as_str()),
461461
clean::BareFunction(ref decl) => {
462462
write!(f, "{}{}fn{}{}",
463463
UnsafetySpace(decl.unsafety),

0 commit comments

Comments
 (0)