Rename method 'to_string' to match conventions.

This commit is contained in:
Corey Farwell 2016-10-01 11:15:42 -04:00
parent c3bc905e5f
commit 0d0f1b4690
2 changed files with 3 additions and 3 deletions

View file

@ -1571,7 +1571,7 @@ impl PrimitiveType {
None
}
pub fn to_string(&self) -> &'static str {
pub fn as_str(&self) -> &'static str {
match *self {
PrimitiveType::Isize => "isize",
PrimitiveType::I8 => "i8",
@ -1596,7 +1596,7 @@ impl PrimitiveType {
}
pub fn to_url_str(&self) -> &'static str {
self.to_string()
self.as_str()
}
/// Creates a rustdoc-specific node id for primitive types.

View file

@ -457,7 +457,7 @@ impl fmt::Display for clean::Type {
tybounds(f, typarams)
}
clean::Infer => write!(f, "_"),
clean::Primitive(prim) => primitive_link(f, prim, prim.to_string()),
clean::Primitive(prim) => primitive_link(f, prim, prim.as_str()),
clean::BareFunction(ref decl) => {
write!(f, "{}{}fn{}{}",
UnsafetySpace(decl.unsafety),