From 42f9c797768f63643fb1ddd29a7fdc33486f69de Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Fri, 17 Jan 2025 18:35:56 +0100 Subject: Handle reexports items list a bit differently since they cannot have documentation --- src/librustdoc/html/render/print_item.rs | 12 +++++------- src/librustdoc/html/static/css/rustdoc.css | 2 +- 2 files changed, 6 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/librustdoc/html/render/print_item.rs b/src/librustdoc/html/render/print_item.rs index 62b1917dfa4..e7700d85344 100644 --- a/src/librustdoc/html/render/print_item.rs +++ b/src/librustdoc/html/render/print_item.rs @@ -141,6 +141,7 @@ macro_rules! item_template_methods { } const ITEM_TABLE_OPEN: &str = "
"; +const REEXPORTS_TABLE_OPEN: &str = "
"; const ITEM_TABLE_CLOSE: &str = "
"; // A component in a `use` path, like `string` in std::string::ToString @@ -398,13 +399,10 @@ fn item_module(w: &mut Buffer, cx: &Context<'_>, item: &clean::Item, items: &[cl w.write_str(ITEM_TABLE_CLOSE); } last_section = Some(my_section); - write_section_heading( - w, - my_section.name(), - &cx.derive_id(my_section.id()), - None, - ITEM_TABLE_OPEN, - ); + let section_id = my_section.id(); + let tag = + if section_id == "reexports" { REEXPORTS_TABLE_OPEN } else { ITEM_TABLE_OPEN }; + write_section_heading(w, my_section.name(), &cx.derive_id(section_id), None, tag); } match myitem.kind { diff --git a/src/librustdoc/html/static/css/rustdoc.css b/src/librustdoc/html/static/css/rustdoc.css index 5c41832d440..f47df5bbcea 100644 --- a/src/librustdoc/html/static/css/rustdoc.css +++ b/src/librustdoc/html/static/css/rustdoc.css @@ -2543,7 +2543,7 @@ in src-script.js and main.js } /* Since the screen is wide enough, we show items on their description on the same line. */ - .item-table { + .item-table:not(.reexports) { display: grid; grid-template-columns: 33% 67%; } -- cgit 1.4.1-3-g733a5