Skip to content

Commit

Permalink
Rollup merge of #82484 - bugadani:docfix, r=jyn514
Browse files Browse the repository at this point in the history
rustdoc: Remove duplicate "List of all items"

Closes #82477

r? `@jyn514`
  • Loading branch information
Aaron1011 committed Feb 25, 2021
2 parents 9a540cb + d3f75eb commit 8250a25
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/librustdoc/html/render/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1343,7 +1343,6 @@ impl AllTypes {
</a>\
</span>
</span>
<span class=\"in-band\">List of all items</span>\
</h1>",
);
// Note: print_entries does not escape the title, because we know the current set of titles
Expand Down
11 changes: 11 additions & 0 deletions src/librustdoc/html/render/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,14 @@ fn test_name_sorting() {
sorted.sort_by(|&l, r| compare_names(l, r));
assert_eq!(names, sorted);
}

#[test]
fn test_all_types_prints_header_once() {
// Regression test for #82477
let all_types = AllTypes::new();

let mut buffer = Buffer::new();
all_types.print(&mut buffer);

assert_eq!(1, buffer.into_inner().matches("List of all items").count());
}

0 comments on commit 8250a25

Please sign in to comment.