]> git.lizzy.rs Git - rust.git/commitdiff
Rename method 'to_string' to match conventions.
authorCorey Farwell <coreyf@rwell.org>
Sat, 1 Oct 2016 15:15:42 +0000 (11:15 -0400)
committerCorey Farwell <coreyf@rwell.org>
Mon, 3 Oct 2016 01:58:19 +0000 (21:58 -0400)
src/librustdoc/clean/mod.rs
src/librustdoc/html/format.rs

index b95ca278707496b4369fb6ed939d4ae8b23ba368..7cde1a9907e9b671a282cf2656823f61b1b2dd02 100644 (file)
@@ -1571,7 +1571,7 @@ fn find(attrs: &[Attribute]) -> Option<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 @@ pub fn to_string(&self) -> &'static str {
     }
 
     pub fn to_url_str(&self) -> &'static str {
-        self.to_string()
+        self.as_str()
     }
 
     /// Creates a rustdoc-specific node id for primitive types.
index adcdc7aaab4005d252381e41dc8dbcca2d3fa158..1b5ac24d86dd7c9f0223e34f05755f2c09953008 100644 (file)
@@ -457,7 +457,7 @@ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
                 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),