File tree Expand file tree Collapse file tree 3 files changed +8
-14
lines changed Expand file tree Collapse file tree 3 files changed +8
-14
lines changed Original file line number Diff line number Diff line change @@ -433,6 +433,7 @@ fn ui_cargo_toml_metadata() {
433
433
#[ derive( Template ) ]
434
434
#[ template( path = "index_template.html" ) ]
435
435
struct Renderer < ' a > {
436
+ count : usize ,
436
437
lints : & ' a Vec < LintMetadata > ,
437
438
}
438
439
@@ -512,7 +513,12 @@ impl DiagnosticCollector {
512
513
513
514
fs:: write (
514
515
"util/gh-pages/index.html" ,
515
- Renderer { lints : & metadata } . render ( ) . unwrap ( ) ,
516
+ Renderer {
517
+ count : LINTS . len ( ) ,
518
+ lints : & metadata,
519
+ }
520
+ . render ( )
521
+ . unwrap ( ) ,
516
522
)
517
523
. unwrap ( ) ;
518
524
} ) ;
Original file line number Diff line number Diff line change 49
49
< script src ="theme.js "> </ script > {# #}
50
50
51
51
< div class ="container "> {# #}
52
- < h1 class ="page-header "> Clippy Lints < span id =" lint-count " class ="badge "> </ span > </ h1 > {# #}
52
+ < h1 class ="page-header "> Clippy Lints < span class ="badge "> Total number: {{+ count }} </ span > </ h1 > {# #}
53
53
54
54
< noscript > {# #}
55
55
< div class ="alert alert-danger " role ="alert "> {# #}
Original file line number Diff line number Diff line change @@ -593,20 +593,8 @@ disableShortcutsButton.checked = disableShortcuts;
593
593
594
594
addListeners ( ) ;
595
595
highlightLazily ( ) ;
596
-
597
- function updateLintCount ( ) {
598
- const allLints = filters . getAllLints ( ) . filter ( lint => lint . group != "deprecated" ) ;
599
- const totalLints = allLints . length ;
600
-
601
- const countElement = document . getElementById ( "lint-count" ) ;
602
- if ( countElement ) {
603
- countElement . innerText = `Total number: ${ totalLints } ` ;
604
- }
605
- }
606
-
607
596
generateSettings ( ) ;
608
597
generateSearch ( ) ;
609
598
parseURLFilters ( ) ;
610
599
scrollToLintByURL ( ) ;
611
600
filters . filterLints ( ) ;
612
- updateLintCount ( ) ;
You can’t perform that action at this time.
0 commit comments