File tree 4 files changed +9
-14
lines changed
4 files changed +9
-14
lines changed Original file line number Diff line number Diff line change @@ -103,6 +103,7 @@ fn update_lints(update_mode: &UpdateMode) {
103
103
pub mod lint;
104
104
pub use lint::Lint;
105
105
pub use lint::LINT_LEVELS;
106
+ pub use lint::LintLevel;
106
107
107
108
pub const ALL_LINTS: [Lint; {}] = {:#?};\n " ,
108
109
sorted_usable_lints. len( ) ,
Original file line number Diff line number Diff line change @@ -130,6 +130,11 @@ Available lint options:
130
130
. iter ( )
131
131
. find ( |level_mapping| level_mapping. 0 == lint. group )
132
132
. map ( |( _, level) | level)
133
+ . map ( |level| match level {
134
+ LintLevel :: Allow => "allow" ,
135
+ LintLevel :: Warn => "warn" ,
136
+ LintLevel :: Deny => "deny" ,
137
+ } )
133
138
. unwrap ( )
134
139
} ;
135
140
@@ -184,7 +189,7 @@ Available lint options:
184
189
s
185
190
} ;
186
191
187
- println ! ( "Lint groups provided by rustc :\n " ) ;
192
+ println ! ( "Lint groups provided by clippy :\n " ) ;
188
193
println ! ( " {} sub-lints" , padded( "name" ) ) ;
189
194
println ! ( " {} ---------" , padded( "----" ) ) ;
190
195
@@ -198,7 +203,7 @@ Available lint options:
198
203
. map ( |name| name. replace ( "_" , "-" ) )
199
204
. collect :: < Vec < String > > ( )
200
205
. join ( ", " ) ;
201
- println ! ( " {} {}" , padded( & name) , desc) ;
206
+ println ! ( " {} {}" , padded( & scoped ( & name) ) , desc) ;
202
207
}
203
208
println ! ( "\n " ) ;
204
209
} ;
Original file line number Diff line number Diff line change @@ -15,18 +15,6 @@ pub enum LintLevel {
15
15
Deny ,
16
16
}
17
17
18
- impl std:: fmt:: Display for LintLevel {
19
- fn fmt ( & self , f : & mut std:: fmt:: Formatter ) -> std:: fmt:: Result {
20
- let s = match self {
21
- LintLevel :: Allow => "allow" ,
22
- LintLevel :: Warn => "warn" ,
23
- LintLevel :: Deny => "deny" ,
24
- } ;
25
-
26
- write ! ( f, "{}" , s)
27
- }
28
- }
29
-
30
18
pub const LINT_LEVELS : [ ( & str , LintLevel ) ; 8 ] = [
31
19
( "correctness" , LintLevel :: Deny ) ,
32
20
( "style" , LintLevel :: Warn ) ,
Original file line number Diff line number Diff line change 3
3
pub mod lint;
4
4
pub use lint:: Lint ;
5
5
pub use lint:: LINT_LEVELS ;
6
+ pub use lint:: LintLevel ;
6
7
7
8
pub const ALL_LINTS : [ Lint ; 304 ] = [
8
9
Lint {
You can’t perform that action at this time.
0 commit comments