@@ -63,7 +63,7 @@ impl Lint {
63
63
64
64
/// Returns all non-deprecated lints and non-internal lints
65
65
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" ) )
67
67
}
68
68
69
69
/// Returns all internal lints (not `internal_warn` lints)
@@ -76,11 +76,6 @@ impl Lint {
76
76
pub fn by_lint_group ( lints : impl Iterator < Item = Self > ) -> HashMap < String , Vec < Self > > {
77
77
lints. map ( |lint| ( lint. group . to_string ( ) , lint) ) . into_group_map ( )
78
78
}
79
-
80
- #[ must_use]
81
- pub fn is_internal ( & self ) -> bool {
82
- self . group . starts_with ( "internal" )
83
- }
84
79
}
85
80
86
81
/// 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> {
103
98
#[ must_use]
104
99
pub fn gen_modules_list ( lints : & [ Lint ] ) -> Vec < String > {
105
100
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 )
114
103
. unique ( )
115
104
. map ( |module| format ! ( "pub mod {};" , module) )
116
105
. sorted ( )
@@ -124,7 +113,7 @@ pub fn gen_changelog_lint_list(lints: &[Lint]) -> Vec<String> {
124
113
. iter ( )
125
114
. sorted_by_key ( |l| l. name . clone ( ) )
126
115
. filter_map ( |l| {
127
- if l. is_internal ( ) {
116
+ if l. group . starts_with ( "internal" ) {
128
117
None
129
118
} else {
130
119
Some ( format ! ( "[`{}`]: {}#{}" , l. name, DOCS_LINK , l. name) )
@@ -158,13 +147,7 @@ pub fn gen_register_lint_list(lints: &[Lint]) -> Vec<String> {
158
147
let post = " ]);" . to_string ( ) ;
159
148
let mut inner = lints
160
149
. 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( ) ) )
168
151
. sorted ( )
169
152
. collect :: < Vec < String > > ( ) ;
170
153
inner. insert ( 0 , pre) ;
0 commit comments