1
Fork 0

rustdoc: Write markdown for argument types

This commit is contained in:
Brian Anderson 2012-01-18 17:10:04 -08:00
parent 6da55efa4e
commit c06e62e0ce

View 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"
);
}