Skip to content

Commit 7d686d6

Browse files
committed
rustdoc: Format return values consistently
1 parent 6ad653b commit 7d686d6

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/rustdoc/markdown_pass.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,7 @@ fn write_return(
533533
) {
534534
alt doc.desc {
535535
some(d) {
536-
ctxt.w.write_line(#fmt("Returns - %s", d));
536+
ctxt.w.write_line(#fmt("Return value: %s", d));
537537
ctxt.w.write_line("");
538538
}
539539
none { }
@@ -544,7 +544,7 @@ fn write_return(
544544
fn should_write_return_type_on_new_line() {
545545
let markdown = test::render(
546546
"#[doc(return = \"test\")] fn a() -> int { }");
547-
assert str::contains(markdown, "\nReturns - test");
547+
assert str::contains(markdown, "\nReturn value: test");
548548
}
549549

550550
#[test]
@@ -553,13 +553,13 @@ fn should_write_blank_line_between_return_type_and_next_header() {
553553
"#[doc(return = \"test\")] fn a() -> int { } \
554554
fn b() -> int { }"
555555
);
556-
assert str::contains(markdown, "Returns - test\n\n##");
556+
assert str::contains(markdown, "Return value: test\n\n##");
557557
}
558558

559559
#[test]
560560
fn should_not_write_return_type_when_there_is_none() {
561561
let markdown = test::render("fn a() { }");
562-
assert !str::contains(markdown, "Returns");
562+
assert !str::contains(markdown, "Return value");
563563
}
564564

565565
#[test]
@@ -808,7 +808,7 @@ fn should_not_write_iface_method_arguments_if_none() {
808808
fn should_write_iface_method_return_info() {
809809
let markdown = test::render(
810810
"iface a { #[doc(return = \"test\")] fn a() -> int; }");
811-
assert str::contains(markdown, "Returns - test");
811+
assert str::contains(markdown, "Return value: test");
812812
}
813813

814814
#[test]
@@ -890,7 +890,7 @@ fn should_not_write_impl_method_arguments_if_none() {
890890
fn should_write_impl_method_return_info() {
891891
let markdown = test::render(
892892
"impl a for int { #[doc(return = \"test\")] fn a() -> int { } }");
893-
assert str::contains(markdown, "Returns - test");
893+
assert str::contains(markdown, "Return value: test");
894894
}
895895

896896
#[test]

0 commit comments

Comments
 (0)