@@ -63,7 +63,7 @@ impl Lint {
6363
6464 /// Returns all non-deprecated lints and non-internal lints
6565 pub fn usable_lints ( lints : impl Iterator < Item = Self > ) -> impl Iterator < Item = Self > {
66- lints. filter ( |l| l. deprecation . is_none ( ) && !l. is_internal ( ) )
66+ lints. filter ( |l| l. deprecation . is_none ( ) && !l. group . starts_with ( "internal" ) )
6767 }
6868
6969 /// Returns all internal lints (not `internal_warn` lints)
@@ -76,11 +76,6 @@ impl Lint {
7676 pub fn by_lint_group ( lints : impl Iterator < Item = Self > ) -> HashMap < String , Vec < Self > > {
7777 lints. map ( |lint| ( lint. group . to_string ( ) , lint) ) . into_group_map ( )
7878 }
79-
80- #[ must_use]
81- pub fn is_internal ( & self ) -> bool {
82- self . group . starts_with ( "internal" )
83- }
8479}
8580
8681/// Generates the Vec items for `register_lint_group` calls in `clippy_lints/src/lib.rs`.
@@ -103,14 +98,8 @@ pub fn gen_lint_group_list(lints: &[Lint]) -> Vec<String> {
10398#[ must_use]
10499pub fn gen_modules_list ( lints : & [ Lint ] ) -> Vec < String > {
105100 lints
106- . into_iter ( )
107- . filter_map ( |l| {
108- if l. is_internal ( ) || l. deprecation . is_some ( ) {
109- None
110- } else {
111- Some ( l. module . clone ( ) )
112- }
113- } )
101+ . iter ( )
102+ . map ( |l| & l. module )
114103 . unique ( )
115104 . map ( |module| format ! ( "pub mod {};" , module) )
116105 . sorted ( )
@@ -124,7 +113,7 @@ pub fn gen_changelog_lint_list(lints: &[Lint]) -> Vec<String> {
124113 . iter ( )
125114 . sorted_by_key ( |l| l. name . clone ( ) )
126115 . filter_map ( |l| {
127- if l. is_internal ( ) {
116+ if l. group . starts_with ( "internal" ) {
128117 None
129118 } else {
130119 Some ( format ! ( "[`{}`]: {}#{}" , l. name, DOCS_LINK , l. name) )
@@ -158,13 +147,7 @@ pub fn gen_register_lint_list(lints: &[Lint]) -> Vec<String> {
158147 let post = " ]);" . to_string ( ) ;
159148 let mut inner = lints
160149 . iter ( )
161- . filter_map ( |l| {
162- if !l. is_internal ( ) && l. deprecation . is_none ( ) {
163- Some ( format ! ( " &{}::{}," , l. module, l. name. to_uppercase( ) ) )
164- } else {
165- None
166- }
167- } )
150+ . map ( |l| format ! ( " &{}::{}," , l. module, l. name. to_uppercase( ) ) )
168151 . sorted ( )
169152 . collect :: < Vec < String > > ( ) ;
170153 inner. insert ( 0 , pre) ;
0 commit comments