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