Skip to content

Commit

Permalink
Remove unneeded self. in templates
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez authored and syphar committed Jul 18, 2024
1 parent 661a7a5 commit bdb6e4e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions templates/crate/features.html
Original file line number Diff line number Diff line change
Expand Up @@ -73,25 +73,25 @@ <h1>{{ metadata.name }}</h1>
{%- else -%}
<p>This version has <b>{{ features.len() }}</b> feature flags, <b data-id="default-feature-len">{{ default_features.len() }}</b> of them enabled by <b>default</b>.</p>
{%- for feature in features -%}
{%- let is_default = feature.name != "default" && self.is_default_feature(feature.name) -%}
{%- let is_default = feature.name != "default" && is_default_feature(feature.name) -%}
<h3 id="{{ feature.name }}">{{ feature.name }}{%- if is_default %} (default){%- endif -%}</h3>
{%- if !feature.subfeatures.is_empty() -%}
<ul class="pure-menu-list">
{%- for (name, feature) in feature.subfeatures -%}
{%- let is_default = self.is_default_feature(name) -%}
{%- let is_default = is_default_feature(name) -%}
<li class="pure-menu-item">
{%- match feature -%}
{%- when SubFeature::Feature with (feature) -%}
<a href="#{{ feature }}">
{{- feature -}}
</a>
{% when SubFeature::Dependency with (dependency) %}
{%- let version = self.dependency_version(dependency) -%}
{%- let version = dependency_version(dependency) -%}
dep:<a href="/crate/{{ dependency }}/{{ version }}">
{{- dependency -}}
</a>
{% when SubFeature::DependencyFeature with {dependency, feature, optional} %}
{%- let version = self.dependency_version(dependency) -%}
{%- let version = dependency_version(dependency) -%}
<a href="/crate/{{ dependency }}/{{ version }}">
{{- dependency -}}
</a>
Expand Down
2 changes: 1 addition & 1 deletion templates/releases/search_results.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

{%- block topbar -%}
{% set is_latest_version = true %}
{% let search_query = self.search_query %}
{% let search_query = search_query %}
{%- include "header/topbar.html" -%}
{%- endblock topbar -%}

Expand Down
2 changes: 1 addition & 1 deletion templates/rustdoc/topbar.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"version": {{ metadata.version|json_encode|safe }}
}
</script>
{%- if let Some(krate) = self.krate() -%}
{%- if let Some(krate) = krate() -%}
<li class="pure-menu-item pure-menu-has-children">
<a href="#" class="pure-menu-link crate-name" title="{{ krate.description.as_deref().unwrap_or_default() }}">
{{ "cube"|fas(false, false, "")|safe }}
Expand Down

0 comments on commit bdb6e4e

Please sign in to comment.