diff options
| author | Dirkjan Ochtman <dirkjan@ochtman.nl> | 2022-01-03 21:16:05 +0100 |
|---|---|---|
| committer | Dirkjan Ochtman <dirkjan@ochtman.nl> | 2022-01-10 18:40:57 +0100 |
| commit | b00d6668b7665fbf040e4768030571bb5aa8c6de (patch) | |
| tree | ffffef6c998e29ddbf1062772ee9890b29947235 | |
| parent | 93a16cb7e2ee415f9b1a46165b297aa16b2a4fa0 (diff) | |
| download | rust-b00d6668b7665fbf040e4768030571bb5aa8c6de.tar.gz rust-b00d6668b7665fbf040e4768030571bb5aa8c6de.zip | |
Address feedback
| -rw-r--r-- | src/librustdoc/html/layout.rs | 6 | ||||
| -rw-r--r-- | src/librustdoc/html/render/print_item.rs | 4 | ||||
| -rw-r--r-- | src/librustdoc/templates/page.html | 10 |
3 files changed, 7 insertions, 13 deletions
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::format::{Buffer, Print}; 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 struct Layout { 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::layout::Page; use crate::html::markdown::{HeadingOffset, MarkdownSummaryLine}; use askama::Template; -use serde::Serialize; const ITEM_TABLE_OPEN: &str = "<div class=\"item-table\">"; const ITEM_TABLE_CLOSE: &str = "</div>"; @@ -41,13 +40,12 @@ const ITEM_TABLE_ROW_OPEN: &str = "<div class=\"item-row\">"; const ITEM_TABLE_ROW_CLOSE: &str = "</div>"; // 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 @@ <link rel="stylesheet" {# -#} href="{{static_root_path|safe}}noscript{{page.resource_suffix}}.css"> {#- -#} </noscript> {#- -#} - {%- match layout.css_file_extension -%} - {%- when Some with (ext) -%} - <link rel="stylesheet" type="text/css" {# -#} - href="{{static_root_path|safe}}theme{{page.resource_suffix}}.css"> {#- -#} - {%- else -%} - {%- endmatch -%} + {%- if layout.css_file_extension.is_some() -%} + <link rel="stylesheet" type="text/css" {# -#} + href="{{static_root_path|safe}}theme{{page.resource_suffix}}.css"> {#- -#} + {%- endif -%} {%- if !layout.favicon.is_empty() -%} <link rel="shortcut icon" href="{{layout.favicon}}"> {#- -#} {%- else -%} |
