Skip to content

Commit

Permalink
Remove unneeded unwrap filter
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez authored and syphar committed Sep 18, 2024
1 parent 4fd0ebe commit 6fabce6
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
4 changes: 0 additions & 4 deletions src/web/page/templates.rs
Original file line number Diff line number Diff line change
Expand Up @@ -247,10 +247,6 @@ pub mod filters {
}
}

pub fn unwrap<T: fmt::Display>(value: &Option<T>) -> rinja::Result<&T> {
Ok(value.as_ref().expect("`unwrap` filter failed"))
}

pub fn split_first<'a>(value: &'a str, pat: &str) -> rinja::Result<Option<&'a str>> {
Ok(value.split(pat).next())
}
Expand Down
2 changes: 1 addition & 1 deletion templates/rustdoc/head.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{%- import "macros.html" as macros -%}
<link rel="stylesheet" href="/-/static/{{rustdoc_css_file|unwrap}}?{{ crate::BUILD_VERSION|slugify }}" media="all" />
<link rel="stylesheet" href="/-/static/{{rustdoc_css_file.as_ref().unwrap()}}?{{ crate::BUILD_VERSION|slugify }}" media="all" />

<link rel="search" href="/-/static/opensearch.xml" type="application/opensearchdescription+xml" title="Docs.rs" />

Expand Down

0 comments on commit 6fabce6

Please sign in to comment.