about summary refs log tree commit diff
path: root/src/librustdoc/html/format.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/librustdoc/html/format.rs')
-rw-r--r--src/librustdoc/html/format.rs29
1 files changed, 14 insertions, 15 deletions
diff --git a/src/librustdoc/html/format.rs b/src/librustdoc/html/format.rs
index 024d010f0b9..3e5afc399b9 100644
--- a/src/librustdoc/html/format.rs
+++ b/src/librustdoc/html/format.rs
@@ -404,6 +404,19 @@ impl fmt::Show for clean::Type {
     }
 }
 
+impl fmt::Show for clean::Arguments {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        for (i, input) in self.values.iter().enumerate() {
+            if i > 0 { if_ok!(write!(f.buf, ", ")); }
+            if input.name.len() > 0 {
+                if_ok!(write!(f.buf, "{}: ", input.name));
+            }
+            if_ok!(write!(f.buf, "{}", input.type_));
+        }
+        Ok(())
+    }
+}
+
 impl fmt::Show for clean::FnDecl {
     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
         write!(f.buf, "({args}){arrow, select, yes{ -> {ret}} other{}}",
@@ -413,20 +426,6 @@ impl fmt::Show for clean::FnDecl {
     }
 }
 
-impl fmt::Show for ~[clean::Argument] {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
-        let mut args = ~"";
-        for (i, input) in self.iter().enumerate() {
-            if i > 0 { args.push_str(", "); }
-            if input.name.len() > 0 {
-                args.push_str(format!("{}: ", input.name));
-            }
-            args.push_str(format!("{}", input.type_));
-        }
-        f.buf.write(args.as_bytes())
-    }
-}
-
 impl<'a> fmt::Show for Method<'a> {
     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
         let Method(selfty, d) = *self;
@@ -448,7 +447,7 @@ impl<'a> fmt::Show for Method<'a> {
                 args.push_str("&amp;self");
             }
         }
-        for (i, input) in d.inputs.iter().enumerate() {
+        for (i, input) in d.inputs.values.iter().enumerate() {
             if i > 0 || args.len() > 0 { args.push_str(", "); }
             if input.name.len() > 0 {
                 args.push_str(format!("{}: ", input.name));