Skip to content

Commit

Permalink
Remove unneeded to_string 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 6fabce6 commit bfbc8bd
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
5 changes: 0 additions & 5 deletions src/web/page/templates.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Cow<'_, str>> {
Expand Down Expand Up @@ -251,10 +250,6 @@ pub mod filters {
Ok(value.split(pat).next())
}

pub fn to_string<T: fmt::Display>(value: &T) -> rinja::Result<String> {
Ok(value.to_string())
}

pub fn json_encode<T: ?Sized + serde::Serialize>(value: &T) -> rinja::Result<String> {
Ok(serde_json::to_string(value).expect("`encode_json` failed"))
}
Expand Down
2 changes: 1 addition & 1 deletion templates/rustdoc/topbar.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<span id="clipboard" class="fa-svg fa-svg-fw" title="Copy crate name and version information">{%- include "clipboard.svg" -%}</span>
</li>

{%- if metadata.req_version|to_string == "latest" -%}
{%- if metadata.req_version.to_string() == "latest" -%}
<li class="pure-menu-item">
<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">
{{ "link"|fas(false, false, "") }} Permalink
Expand Down

0 comments on commit bfbc8bd

Please sign in to comment.