Skip to content

Commit c06e62e

Browse files
committed
rustdoc: Write markdown for argument types
1 parent 6da55ef commit c06e62e

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/rustdoc/gen.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,12 @@ fn write_args(
136136
}
137137

138138
fn write_arg(ctxt: ctxt, arg: doc::argdoc) {
139-
ctxt.w.write_line(#fmt("* %s", arg.name));
139+
assert option::is_some(arg.ty);
140+
ctxt.w.write_line(#fmt(
141+
"* %s: `%s`",
142+
arg.name,
143+
option::get(arg.ty)
144+
));
140145
}
141146

142147
#[test]
@@ -147,8 +152,8 @@ fn should_write_argument_list() {
147152
markdown,
148153
"Arguments:\n\
149154
\n\
150-
* b\n\
151-
* c\n\
155+
* b: `int`\n\
156+
* c: `int`\n\
152157
\n"
153158
);
154159
}

0 commit comments

Comments
 (0)