]> git.lizzy.rs Git - rust.git/commitdiff
rustdoc: Write markdown for argument types
authorBrian Anderson <banderson@mozilla.com>
Thu, 19 Jan 2012 01:10:04 +0000 (17:10 -0800)
committerBrian Anderson <banderson@mozilla.com>
Thu, 19 Jan 2012 01:10:04 +0000 (17:10 -0800)
src/rustdoc/gen.rs

index ce5ed876b52f37a4c7224bcdac7ef31b4a08fe7c..0b7767ec56e624f1e0d7ae9f9c141e92d2dec39f 100644 (file)
@@ -136,7 +136,12 @@ fn write_args(
 }
 
 fn write_arg(ctxt: ctxt, arg: doc::argdoc) {
-    ctxt.w.write_line(#fmt("* %s", arg.name));
+    assert option::is_some(arg.ty);
+    ctxt.w.write_line(#fmt(
+        "* %s: `%s`",
+        arg.name,
+        option::get(arg.ty)
+    ));
 }
 
 #[test]
@@ -147,8 +152,8 @@ fn should_write_argument_list() {
         markdown,
         "Arguments:\n\
          \n\
-         * b\n\
-         * c\n\
+         * b: `int`\n\
+         * c: `int`\n\
          \n"
     );
 }