@@ -458,7 +458,7 @@ impl<'hir> Map<'hir> {
458458 }
459459
460460 pub fn body_owner_kind ( & self , id : HirId ) -> BodyOwnerKind {
461- match self . get_by_hir_id ( id) {
461+ match self . get ( id) {
462462 Node :: Item ( & Item { node : ItemKind :: Const ( ..) , .. } ) |
463463 Node :: TraitItem ( & TraitItem { node : TraitItemKind :: Const ( ..) , .. } ) |
464464 Node :: ImplItem ( & ImplItem { node : ImplItemKind :: Const ( ..) , .. } ) |
@@ -482,7 +482,7 @@ impl<'hir> Map<'hir> {
482482 }
483483
484484 pub fn ty_param_owner ( & self , id : HirId ) -> HirId {
485- match self . get_by_hir_id ( id) {
485+ match self . get ( id) {
486486 Node :: Item ( & Item { node : ItemKind :: Trait ( ..) , .. } ) |
487487 Node :: Item ( & Item { node : ItemKind :: TraitAlias ( ..) , .. } ) => id,
488488 Node :: GenericParam ( _) => self . get_parent_node_by_hir_id ( id) ,
@@ -491,7 +491,7 @@ impl<'hir> Map<'hir> {
491491 }
492492
493493 pub fn ty_param_name ( & self , id : HirId ) -> Name {
494- match self . get_by_hir_id ( id) {
494+ match self . get ( id) {
495495 Node :: Item ( & Item { node : ItemKind :: Trait ( ..) , .. } ) |
496496 Node :: Item ( & Item { node : ItemKind :: TraitAlias ( ..) , .. } ) => kw:: SelfUpper ,
497497 Node :: GenericParam ( param) => param. name . ident ( ) . name ,
@@ -561,14 +561,14 @@ impl<'hir> Map<'hir> {
561561 }
562562
563563 /// 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 > {
565565 // read recorded by `find`
566566 self . find_by_hir_id ( id) . unwrap_or_else ( ||
567567 bug ! ( "couldn't find hir id {} in the HIR map" , id) )
568568 }
569569
570570 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`
572572 }
573573
574574 pub fn get_generics ( & self , id : DefId ) -> Option < & ' hir Generics > {
@@ -840,7 +840,7 @@ impl<'hir> Map<'hir> {
840840 if scope == CRATE_HIR_ID {
841841 return Some ( CRATE_HIR_ID ) ;
842842 }
843- match self . get_by_hir_id ( scope) {
843+ match self . get ( scope) {
844844 Node :: Item ( i) => {
845845 match i. node {
846846 ItemKind :: Existential ( ExistTy { impl_trait_fn : None , .. } ) => { }
@@ -929,7 +929,7 @@ impl<'hir> Map<'hir> {
929929 }
930930
931931 pub fn name ( & self , id : HirId ) -> Name {
932- match self . get_by_hir_id ( id) {
932+ match self . get ( id) {
933933 Node :: Item ( i) => i. ident . name ,
934934 Node :: ForeignItem ( fi) => fi. ident . name ,
935935 Node :: ImplItem ( ii) => ii. ident . name ,
@@ -1061,7 +1061,7 @@ impl<'hir> Map<'hir> {
10611061 }
10621062
10631063 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) ) )
10651065 }
10661066}
10671067
0 commit comments