From bfbc8bd47eedecbc18f96b2b6635ed5bac794dcf Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Tue, 17 Sep 2024 17:35:41 +0200 Subject: [PATCH] Remove unneeded `to_string` filter --- src/web/page/templates.rs | 5 ----- templates/rustdoc/topbar.html | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/src/web/page/templates.rs b/src/web/page/templates.rs index c648be86e..3145fb3ab 100644 --- a/src/web/page/templates.rs +++ b/src/web/page/templates.rs @@ -92,7 +92,6 @@ pub mod filters { use chrono::{DateTime, Utc}; use rinja::filters::Safe; use std::borrow::Cow; - use std::fmt; // Copied from `tera`. pub fn escape_html(input: &str) -> rinja::Result> { @@ -251,10 +250,6 @@ pub mod filters { Ok(value.split(pat).next()) } - pub fn to_string(value: &T) -> rinja::Result { - Ok(value.to_string()) - } - pub fn json_encode(value: &T) -> rinja::Result { Ok(serde_json::to_string(value).expect("`encode_json` failed")) } diff --git a/templates/rustdoc/topbar.html b/templates/rustdoc/topbar.html index 6e4eb116f..7eb80f079 100644 --- a/templates/rustdoc/topbar.html +++ b/templates/rustdoc/topbar.html @@ -36,7 +36,7 @@ {%- include "clipboard.svg" -%} - {%- if metadata.req_version|to_string == "latest" -%} + {%- if metadata.req_version.to_string() == "latest" -%}