@@ -66,17 +66,12 @@ rustc_index::newtype_index! {
66
66
}
67
67
68
68
#[ derive( Debug , HashStable ) ]
69
- pub enum LintSet {
70
- CommandLine {
71
- // -A,-W,-D flags, a `Symbol` for the flag itself and `Level` for which
72
- // flag.
73
- specs : FxHashMap < LintId , LevelAndSource > ,
74
- } ,
75
-
76
- Node {
77
- specs : FxHashMap < LintId , LevelAndSource > ,
78
- parent : LintStackIndex ,
79
- } ,
69
+ pub struct LintSet {
70
+ // -A,-W,-D flags, a `Symbol` for the flag itself and `Level` for which
71
+ // flag.
72
+ pub specs : FxHashMap < LintId , LevelAndSource > ,
73
+
74
+ pub parent : LintStackIndex ,
80
75
}
81
76
82
77
impl LintLevelSets {
@@ -139,20 +134,14 @@ impl LintLevelSets {
139
134
}
140
135
}
141
136
loop {
142
- match self . list [ idx] {
143
- LintSet :: CommandLine { ref specs } => {
144
- if let Some ( & ( level, src) ) = specs. get ( & id) {
145
- return ( Some ( level) , src) ;
146
- }
147
- return ( None , LintLevelSource :: Default ) ;
148
- }
149
- LintSet :: Node { ref specs, parent } => {
150
- if let Some ( & ( level, src) ) = specs. get ( & id) {
151
- return ( Some ( level) , src) ;
152
- }
153
- idx = parent;
154
- }
137
+ let LintSet { ref specs, parent } = self . list [ idx] ;
138
+ if let Some ( & ( level, src) ) = specs. get ( & id) {
139
+ return ( Some ( level) , src) ;
140
+ }
141
+ if idx == COMMAND_LINE {
142
+ return ( None , LintLevelSource :: Default ) ;
155
143
}
144
+ idx = parent;
156
145
}
157
146
}
158
147
}
0 commit comments