Skip to content

Commit 8daad49

Browse files
committed
rustdoc: put the toolbar on the all item index
1 parent eabf390 commit 8daad49

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

src/librustdoc/html/render/mod.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -601,7 +601,12 @@ impl AllTypes {
601601
}
602602

603603
fmt::from_fn(|f| {
604-
f.write_str("<h1>List of all items</h1>")?;
604+
f.write_str(
605+
"<div class=\"main-heading\">\
606+
<h1>List of all items</h1>\
607+
<rustdoc-toolbar></rustdoc-toolbar>\
608+
</div>",
609+
)?;
605610
// Note: print_entries does not escape the title, because we know the current set of titles
606611
// doesn't require escaping.
607612
print_entries(&self.structs, ItemSection::Structs).fmt(f)?;

src/librustdoc/html/render/write_shared.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -386,8 +386,13 @@ impl CratesIndexPart {
386386
let layout = &cx.shared.layout;
387387
let style_files = &cx.shared.style_files;
388388
const DELIMITER: &str = "\u{FFFC}"; // users are being naughty if they have this
389-
let content =
390-
format!("<h1>List of all crates</h1><ul class=\"all-items\">{DELIMITER}</ul>");
389+
let content = format!(
390+
"<div class=\"main-heading\">\
391+
<h1>List of all crates</h1>\
392+
<rustdoc-toolbar></rustdoc-toolbar>\
393+
</div>\
394+
<ul class=\"all-items\">{DELIMITER}</ul>"
395+
);
391396
let template = layout::render(layout, &page, "", content, style_files);
392397
SortedTemplate::from_template(&template, DELIMITER)
393398
.expect("Object Replacement Character (U+FFFC) should not appear in the --index-page")

0 commit comments

Comments
 (0)