Skip to content

Commit bfbc8bd

Browse files
GuillaumeGomezsyphar
authored andcommitted
Remove unneeded to_string filter
1 parent 6fabce6 commit bfbc8bd

File tree

2 files changed

+1
-6
lines changed

2 files changed

+1
-6
lines changed

src/web/page/templates.rs

-5
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ pub mod filters {
9292
use chrono::{DateTime, Utc};
9393
use rinja::filters::Safe;
9494
use std::borrow::Cow;
95-
use std::fmt;
9695

9796
// Copied from `tera`.
9897
pub fn escape_html(input: &str) -> rinja::Result<Cow<'_, str>> {
@@ -251,10 +250,6 @@ pub mod filters {
251250
Ok(value.split(pat).next())
252251
}
253252

254-
pub fn to_string<T: fmt::Display>(value: &T) -> rinja::Result<String> {
255-
Ok(value.to_string())
256-
}
257-
258253
pub fn json_encode<T: ?Sized + serde::Serialize>(value: &T) -> rinja::Result<String> {
259254
Ok(serde_json::to_string(value).expect("`encode_json` failed"))
260255
}

templates/rustdoc/topbar.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
<span id="clipboard" class="fa-svg fa-svg-fw" title="Copy crate name and version information">{%- include "clipboard.svg" -%}</span>
3737
</li>
3838

39-
{%- if metadata.req_version|to_string == "latest" -%}
39+
{%- if metadata.req_version.to_string() == "latest" -%}
4040
<li class="pure-menu-item">
4141
<a href="{% if permalink_path is defined %}{{permalink_path|safe}}{% endif %}" class="pure-menu-link description" id="permalink" title="Get a link to this specific version">
4242
{{ "link"|fas(false, false, "") }} Permalink

0 commit comments

Comments
 (0)