diff --git a/src/librustdoc/html/layout.rs b/src/librustdoc/html/layout.rs index 1eba43d26b2..38d333cc983 100644 --- a/src/librustdoc/html/layout.rs +++ b/src/librustdoc/html/layout.rs @@ -8,9 +8,8 @@ use crate::html::render::{ensure_trailing_slash, StylePath}; use askama::Template; -use serde::Serialize; -#[derive(Clone, Serialize)] +#[derive(Clone)] crate struct Layout { crate logo: String, crate favicon: String, @@ -27,7 +26,6 @@ crate scrape_examples_extension: bool, } -#[derive(Serialize)] crate struct Page<'a> { crate title: &'a str, crate css_class: &'a str, @@ -46,7 +44,7 @@ impl<'a> Page<'a> { } } -#[derive(Serialize, Template)] +#[derive(Template)] #[template(path = "page.html")] struct PageLayout<'a> { static_root_path: &'a str, diff --git a/src/librustdoc/html/render/print_item.rs b/src/librustdoc/html/render/print_item.rs index 29e03f7f65b..52268987a20 100644 --- a/src/librustdoc/html/render/print_item.rs +++ b/src/librustdoc/html/render/print_item.rs @@ -33,7 +33,6 @@ use crate::html::markdown::{HeadingOffset, MarkdownSummaryLine}; use askama::Template; -use serde::Serialize; const ITEM_TABLE_OPEN: &str = "
"; const ITEM_TABLE_CLOSE: &str = "
"; @@ -41,13 +40,12 @@ const ITEM_TABLE_ROW_CLOSE: &str = ""; // A component in a `use` path, like `string` in std::string::ToString -#[derive(Serialize)] struct PathComponent<'a> { path: String, name: &'a str, } -#[derive(Serialize, Template)] +#[derive(Template)] #[template(path = "print_item.html")] struct ItemVars<'a> { page: &'a Page<'a>, diff --git a/src/librustdoc/templates/page.html b/src/librustdoc/templates/page.html index e26d9856221..673260ac6d0 100644 --- a/src/librustdoc/templates/page.html +++ b/src/librustdoc/templates/page.html @@ -49,12 +49,10 @@ {#- -#} {#- -#} - {%- match layout.css_file_extension -%} - {%- when Some with (ext) -%} - {#- -#} - {%- else -%} - {%- endmatch -%} + {%- if layout.css_file_extension.is_some() -%} + {#- -#} + {%- endif -%} {%- if !layout.favicon.is_empty() -%} {#- -#} {%- else -%}