about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--tests/compile-test.rs8
-rw-r--r--util/gh-pages/index_template.html2
-rw-r--r--util/gh-pages/script.js12
3 files changed, 8 insertions, 14 deletions
diff --git a/tests/compile-test.rs b/tests/compile-test.rs
index 664a748ee21..6b6dfd7b81e 100644
--- a/tests/compile-test.rs
+++ b/tests/compile-test.rs
@@ -433,6 +433,7 @@ fn ui_cargo_toml_metadata() {
 #[derive(Template)]
 #[template(path = "index_template.html")]
 struct Renderer<'a> {
+    count: usize,
     lints: &'a Vec<LintMetadata>,
 }
 
@@ -512,7 +513,12 @@ impl DiagnosticCollector {
 
             fs::write(
                 "util/gh-pages/index.html",
-                Renderer { lints: &metadata }.render().unwrap(),
+                Renderer {
+                    count: LINTS.len(),
+                    lints: &metadata,
+                }
+                .render()
+                .unwrap(),
             )
             .unwrap();
         });
diff --git a/util/gh-pages/index_template.html b/util/gh-pages/index_template.html
index 5d65ea585df..327ccf6439e 100644
--- a/util/gh-pages/index_template.html
+++ b/util/gh-pages/index_template.html
@@ -49,7 +49,7 @@ Otherwise, have a great day =^.^=
     <script src="theme.js"></script> {# #}
 
     <div class="container"> {# #}
-        <h1 class="page-header">Clippy Lints <span id="lint-count" class="badge"></span></h1> {# #}
+        <h1 class="page-header">Clippy Lints <span class="badge">Total number: {{+ count }}</span></h1> {# #}
 
         <noscript> {# #}
             <div class="alert alert-danger" role="alert"> {# #}
diff --git a/util/gh-pages/script.js b/util/gh-pages/script.js
index cfc5fb7b27c..2b6ee67c37d 100644
--- a/util/gh-pages/script.js
+++ b/util/gh-pages/script.js
@@ -593,20 +593,8 @@ disableShortcutsButton.checked = disableShortcuts;
 
 addListeners();
 highlightLazily();
-
-function updateLintCount() {
-    const allLints = filters.getAllLints().filter(lint => lint.group != "deprecated");
-    const totalLints = allLints.length;
-
-    const countElement = document.getElementById("lint-count");
-    if (countElement) {
-        countElement.innerText = `Total number: ${totalLints}`;
-    }
-}
-
 generateSettings();
 generateSearch();
 parseURLFilters();
 scrollToLintByURL();
 filters.filterLints();
-updateLintCount();