@@ -458,7 +458,7 @@ impl<'hir> Map<'hir> {
458
458
}
459
459
460
460
pub fn body_owner_kind ( & self , id : HirId ) -> BodyOwnerKind {
461
- match self . get_by_hir_id ( id) {
461
+ match self . get ( id) {
462
462
Node :: Item ( & Item { node : ItemKind :: Const ( ..) , .. } ) |
463
463
Node :: TraitItem ( & TraitItem { node : TraitItemKind :: Const ( ..) , .. } ) |
464
464
Node :: ImplItem ( & ImplItem { node : ImplItemKind :: Const ( ..) , .. } ) |
@@ -482,7 +482,7 @@ impl<'hir> Map<'hir> {
482
482
}
483
483
484
484
pub fn ty_param_owner ( & self , id : HirId ) -> HirId {
485
- match self . get_by_hir_id ( id) {
485
+ match self . get ( id) {
486
486
Node :: Item ( & Item { node : ItemKind :: Trait ( ..) , .. } ) |
487
487
Node :: Item ( & Item { node : ItemKind :: TraitAlias ( ..) , .. } ) => id,
488
488
Node :: GenericParam ( _) => self . get_parent_node_by_hir_id ( id) ,
@@ -491,7 +491,7 @@ impl<'hir> Map<'hir> {
491
491
}
492
492
493
493
pub fn ty_param_name ( & self , id : HirId ) -> Name {
494
- match self . get_by_hir_id ( id) {
494
+ match self . get ( id) {
495
495
Node :: Item ( & Item { node : ItemKind :: Trait ( ..) , .. } ) |
496
496
Node :: Item ( & Item { node : ItemKind :: TraitAlias ( ..) , .. } ) => kw:: SelfUpper ,
497
497
Node :: GenericParam ( param) => param. name . ident ( ) . name ,
@@ -561,14 +561,14 @@ impl<'hir> Map<'hir> {
561
561
}
562
562
563
563
/// Retrieves the `Node` corresponding to `id`, panicking if it cannot be found.
564
- pub fn get_by_hir_id ( & self , id : HirId ) -> Node < ' hir > {
564
+ pub fn get ( & self , id : HirId ) -> Node < ' hir > {
565
565
// read recorded by `find`
566
566
self . find_by_hir_id ( id) . unwrap_or_else ( ||
567
567
bug ! ( "couldn't find hir id {} in the HIR map" , id) )
568
568
}
569
569
570
570
pub fn get_if_local ( & self , id : DefId ) -> Option < Node < ' hir > > {
571
- self . as_local_hir_id ( id) . map ( |id| self . get_by_hir_id ( id) ) // read recorded by `get`
571
+ self . as_local_hir_id ( id) . map ( |id| self . get ( id) ) // read recorded by `get`
572
572
}
573
573
574
574
pub fn get_generics ( & self , id : DefId ) -> Option < & ' hir Generics > {
@@ -840,7 +840,7 @@ impl<'hir> Map<'hir> {
840
840
if scope == CRATE_HIR_ID {
841
841
return Some ( CRATE_HIR_ID ) ;
842
842
}
843
- match self . get_by_hir_id ( scope) {
843
+ match self . get ( scope) {
844
844
Node :: Item ( i) => {
845
845
match i. node {
846
846
ItemKind :: Existential ( ExistTy { impl_trait_fn : None , .. } ) => { }
@@ -929,7 +929,7 @@ impl<'hir> Map<'hir> {
929
929
}
930
930
931
931
pub fn name ( & self , id : HirId ) -> Name {
932
- match self . get_by_hir_id ( id) {
932
+ match self . get ( id) {
933
933
Node :: Item ( i) => i. ident . name ,
934
934
Node :: ForeignItem ( fi) => fi. ident . name ,
935
935
Node :: ImplItem ( ii) => ii. ident . name ,
@@ -1061,7 +1061,7 @@ impl<'hir> Map<'hir> {
1061
1061
}
1062
1062
1063
1063
pub fn hir_to_pretty_string ( & self , id : HirId ) -> String {
1064
- print:: to_string ( self , |s| s. print_node ( self . get_by_hir_id ( id) ) )
1064
+ print:: to_string ( self , |s| s. print_node ( self . get ( id) ) )
1065
1065
}
1066
1066
}
1067
1067
0 commit comments