@@ -57,9 +57,10 @@ impl Lint {
57
57
}
58
58
}
59
59
60
- /// Returns all non-deprecated lints
61
- pub fn active_lints ( lints : impl Iterator < Item =Self > ) -> impl Iterator < Item =Self > {
62
- lints. filter ( |l| l. deprecation . is_none ( ) )
60
+ /// Returns all non-deprecated lints and non-internal lints
61
+ pub fn usable_lints ( lints : impl Iterator < Item =Self > ) -> impl Iterator < Item =Self > {
62
+ lints
63
+ . filter ( |l| l. deprecation . is_none ( ) && !l. group . starts_with ( "internal" ) )
63
64
}
64
65
65
66
/// Returns the lints in a HashMap, grouped by the different lint groups
@@ -141,15 +142,17 @@ declare_deprecated_lint! {
141
142
}
142
143
143
144
#[ test]
144
- fn test_active_lints ( ) {
145
+ fn test_usable_lints ( ) {
145
146
let lints = vec ! [
146
147
Lint :: new( "should_assert_eq" , "Deprecated" , "abc" , Some ( "Reason" ) , "module_name" ) ,
147
- Lint :: new( "should_assert_eq2" , "Not Deprecated" , "abc" , None , "module_name" )
148
+ Lint :: new( "should_assert_eq2" , "Not Deprecated" , "abc" , None , "module_name" ) ,
149
+ Lint :: new( "should_assert_eq2" , "internal" , "abc" , None , "module_name" ) ,
150
+ Lint :: new( "should_assert_eq2" , "internal_style" , "abc" , None , "module_name" )
148
151
] ;
149
152
let expected = vec ! [
150
153
Lint :: new( "should_assert_eq2" , "Not Deprecated" , "abc" , None , "module_name" )
151
154
] ;
152
- assert_eq ! ( expected, Lint :: active_lints ( lints. into_iter( ) ) . collect:: <Vec <Lint >>( ) ) ;
155
+ assert_eq ! ( expected, Lint :: usable_lints ( lints. into_iter( ) ) . collect:: <Vec <Lint >>( ) ) ;
153
156
}
154
157
155
158
#[ test]
0 commit comments