1
- use self :: Namespace :: * ;
2
-
3
1
use crate :: hir;
4
2
use crate :: hir:: def_id:: { DefId , DefIdMap , CRATE_DEF_INDEX , LOCAL_CRATE } ;
5
3
use crate :: ty;
@@ -238,9 +236,9 @@ pub enum Namespace {
238
236
impl Namespace {
239
237
pub fn descr ( self ) -> & ' static str {
240
238
match self {
241
- TypeNS => "type" ,
242
- ValueNS => "value" ,
243
- MacroNS => "macro" ,
239
+ Self :: TypeNS => "type" ,
240
+ Self :: ValueNS => "value" ,
241
+ Self :: MacroNS => "macro" ,
244
242
}
245
243
}
246
244
}
@@ -264,19 +262,19 @@ impl<T> ::std::ops::Index<Namespace> for PerNS<T> {
264
262
265
263
fn index ( & self , ns : Namespace ) -> & T {
266
264
match ns {
267
- ValueNS => & self . value_ns ,
268
- TypeNS => & self . type_ns ,
269
- MacroNS => & self . macro_ns ,
265
+ Namespace :: ValueNS => & self . value_ns ,
266
+ Namespace :: TypeNS => & self . type_ns ,
267
+ Namespace :: MacroNS => & self . macro_ns ,
270
268
}
271
269
}
272
270
}
273
271
274
272
impl < T > :: std:: ops:: IndexMut < Namespace > for PerNS < T > {
275
273
fn index_mut ( & mut self , ns : Namespace ) -> & mut T {
276
274
match ns {
277
- ValueNS => & mut self . value_ns ,
278
- TypeNS => & mut self . type_ns ,
279
- MacroNS => & mut self . macro_ns ,
275
+ Namespace :: ValueNS => & mut self . value_ns ,
276
+ Namespace :: TypeNS => & mut self . type_ns ,
277
+ Namespace :: MacroNS => & mut self . macro_ns ,
280
278
}
281
279
}
282
280
}
0 commit comments