File tree Expand file tree Collapse file tree 2 files changed +8
-10
lines changed Expand file tree Collapse file tree 2 files changed +8
-10
lines changed Original file line number Diff line number Diff line change @@ -230,14 +230,6 @@ pub mod filters {
230230 Ok ( ( ( multiplier * * value) . round ( ) / multiplier) . to_string ( ) )
231231 }
232232
233- pub fn opt_date ( value : & Option < DateTime < Utc > > , format : & str ) -> rinja:: Result < String > {
234- if let Some ( value) = value {
235- Ok ( value. format ( format) . to_string ( ) )
236- } else {
237- Ok ( String :: new ( ) )
238- }
239- }
240-
241233 pub fn split_first < ' a > ( value : & ' a str , pat : & str ) -> rinja:: Result < Option < & ' a str > > {
242234 Ok ( value. split ( pat) . next ( ) )
243235 }
Original file line number Diff line number Diff line change 1111 <id >urn:docs-rs:{{ crate::BUILD_VERSION }}</id >
1212 <updated >
1313 {%- if let Some(first_release) = recent_releases.get(0) -%}
14- {{ first_release.build_time|opt_date("%+") }}
14+ {%- if let Some(build_time) = first_release.build_time -%}
15+ {{ build_time.format("%+") }}
16+ {%- endif -%}
1517 {%- endif -%}
1618 </updated >
1719
2830
2931 <link href =" {{ link|safe }}" />
3032 <id >urn:docs-rs:{{ release.name }}:{{ release.version }}</id >
31- <updated >{{ release.build_time|opt_date("%+") }}</updated >
33+ <updated >
34+ {% if let Some(build_time) = release.build_time -%}
35+ {{ build_time.format("%+") }}
36+ {%- endif -%}
37+ </updated >
3238
3339 <summary >
3440 {%- if let Some(description) = release.description -%}
You can’t perform that action at this time.
0 commit comments