rustdoc: Write markdown for argument types
This commit is contained in:
parent
6da55efa4e
commit
c06e62e0ce
1 changed files with 8 additions and 3 deletions
|
@ -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"
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue