Skip to content

Commit 1664d40

Browse files
committed
---
yaml --- r: 7648 b: refs/heads/master c: f4c31bd h: refs/heads/master v: v3
1 parent 9a62adf commit 1664d40

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: fa3368bc71611f071489a3a5183bd572bc6f4022
2+
refs/heads/master: f4c31bda62dd42d6d7990a2e56821eff12099bf7

trunk/src/rustdoc/gen.rs

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -226,14 +226,16 @@ fn write_return(
226226
) {
227227
alt doc.ty {
228228
some(ty) {
229-
ctxt.w.write_line(#fmt("Returns `%s`", ty));
230-
ctxt.w.write_line("");
229+
ctxt.w.write_str(#fmt("Returns `%s`", ty));
231230
alt doc.desc {
232231
some(d) {
233-
ctxt.w.write_line(d);
232+
ctxt.w.write_line(#fmt(" - %s", d));
233+
ctxt.w.write_line("");
234+
}
235+
none {
236+
ctxt.w.write_line("");
234237
ctxt.w.write_line("");
235238
}
236-
none { }
237239
}
238240
}
239241
none { }
@@ -269,6 +271,14 @@ fn should_write_blank_line_after_return_description() {
269271
assert str::contains(markdown, "blorp\n\n");
270272
}
271273

274+
#[test]
275+
fn should_write_return_description_on_same_line_as_type() {
276+
let markdown = test::render(
277+
"#[doc(return = \"blorp\")] fn a() -> int { }"
278+
);
279+
assert str::contains(markdown, "Returns `int` - blorp");
280+
}
281+
272282
#[cfg(test)]
273283
mod test {
274284
fn render(source: str) -> str {

0 commit comments

Comments
 (0)