Skip to content

Commit b00d666

Browse files
committed
Address feedback
1 parent 93a16cb commit b00d666

File tree

3 files changed

+7
-13
lines changed

3 files changed

+7
-13
lines changed

Diff for: src/librustdoc/html/layout.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,8 @@ use crate::html::format::{Buffer, Print};
88
use crate::html::render::{ensure_trailing_slash, StylePath};
99

1010
use askama::Template;
11-
use serde::Serialize;
1211

13-
#[derive(Clone, Serialize)]
12+
#[derive(Clone)]
1413
crate struct Layout {
1514
crate logo: String,
1615
crate favicon: String,
@@ -27,7 +26,6 @@ crate struct Layout {
2726
crate scrape_examples_extension: bool,
2827
}
2928

30-
#[derive(Serialize)]
3129
crate struct Page<'a> {
3230
crate title: &'a str,
3331
crate css_class: &'a str,
@@ -46,7 +44,7 @@ impl<'a> Page<'a> {
4644
}
4745
}
4846

49-
#[derive(Serialize, Template)]
47+
#[derive(Template)]
5048
#[template(path = "page.html")]
5149
struct PageLayout<'a> {
5250
static_root_path: &'a str,

Diff for: src/librustdoc/html/render/print_item.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -33,21 +33,19 @@ use crate::html::layout::Page;
3333
use crate::html::markdown::{HeadingOffset, MarkdownSummaryLine};
3434

3535
use askama::Template;
36-
use serde::Serialize;
3736

3837
const ITEM_TABLE_OPEN: &str = "<div class=\"item-table\">";
3938
const ITEM_TABLE_CLOSE: &str = "</div>";
4039
const ITEM_TABLE_ROW_OPEN: &str = "<div class=\"item-row\">";
4140
const ITEM_TABLE_ROW_CLOSE: &str = "</div>";
4241

4342
// A component in a `use` path, like `string` in std::string::ToString
44-
#[derive(Serialize)]
4543
struct PathComponent<'a> {
4644
path: String,
4745
name: &'a str,
4846
}
4947

50-
#[derive(Serialize, Template)]
48+
#[derive(Template)]
5149
#[template(path = "print_item.html")]
5250
struct ItemVars<'a> {
5351
page: &'a Page<'a>,

Diff for: src/librustdoc/templates/page.html

+4-6
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,10 @@
4949
<link rel="stylesheet" {# -#}
5050
href="{{static_root_path|safe}}noscript{{page.resource_suffix}}.css"> {#- -#}
5151
</noscript> {#- -#}
52-
{%- match layout.css_file_extension -%}
53-
{%- when Some with (ext) -%}
54-
<link rel="stylesheet" type="text/css" {# -#}
55-
href="{{static_root_path|safe}}theme{{page.resource_suffix}}.css"> {#- -#}
56-
{%- else -%}
57-
{%- endmatch -%}
52+
{%- if layout.css_file_extension.is_some() -%}
53+
<link rel="stylesheet" type="text/css" {# -#}
54+
href="{{static_root_path|safe}}theme{{page.resource_suffix}}.css"> {#- -#}
55+
{%- endif -%}
5856
{%- if !layout.favicon.is_empty() -%}
5957
<link rel="shortcut icon" href="{{layout.favicon}}"> {#- -#}
6058
{%- else -%}

0 commit comments

Comments
 (0)