@@ -128,9 +128,13 @@ pub enum InlinedItemKindRef<'a> {
128128}
129129
130130impl < ' a > InlinedItemRef < ' a > {
131- pub fn from_item < ' ast : ' a > ( def_id : DefId , item : & ' a hir:: Item , map : & hir_map:: Map < ' ast > ) -> InlinedItemRef < ' a > {
131+ pub fn from_item < ' ast : ' a > ( def_id : DefId ,
132+ item : & ' a hir:: Item ,
133+ map : & hir_map:: Map < ' ast > )
134+ -> InlinedItemRef < ' a > {
132135 let ( body, kind) = match item. node {
133- hir:: ItemFn ( ref decl, _, _, _, _, body_id) => ( map. expr ( body_id) , InlinedItemKindRef :: Fn ( & decl) ) ,
136+ hir:: ItemFn ( ref decl, _, _, _, _, body_id) =>
137+ ( map. expr ( body_id) , InlinedItemKindRef :: Fn ( & decl) ) ,
134138 hir:: ItemConst ( ref ty, ref body) => ( & * * body, InlinedItemKindRef :: Const ( ty) ) ,
135139 _ => bug ! ( "InlinedItemRef::from_item wrong kind" )
136140 } ;
@@ -141,10 +145,15 @@ impl<'a> InlinedItemRef<'a> {
141145 }
142146 }
143147
144- pub fn from_trait_item ( def_id : DefId , item : & ' a hir:: TraitItem , _map : & hir_map:: Map ) -> InlinedItemRef < ' a > {
148+ pub fn from_trait_item ( def_id : DefId ,
149+ item : & ' a hir:: TraitItem ,
150+ _map : & hir_map:: Map )
151+ -> InlinedItemRef < ' a > {
145152 let ( body, kind) = match item. node {
146153 hir:: ConstTraitItem ( ref ty, Some ( ref body) ) => ( & * * body, InlinedItemKindRef :: Const ( ty) ) ,
147- hir:: ConstTraitItem ( _, None ) => bug ! ( "InlinedItemRef::from_trait_item called for const without body" ) ,
154+ hir:: ConstTraitItem ( _, None ) => {
155+ bug ! ( "InlinedItemRef::from_trait_item called for const without body" )
156+ } ,
148157 _ => bug ! ( "InlinedItemRef::from_trait_item wrong kind" )
149158 } ;
150159 InlinedItemRef {
@@ -154,9 +163,13 @@ impl<'a> InlinedItemRef<'a> {
154163 }
155164 }
156165
157- pub fn from_impl_item < ' ast : ' a > ( def_id : DefId , item : & ' a hir:: ImplItem , map : & hir_map:: Map < ' ast > ) -> InlinedItemRef < ' a > {
166+ pub fn from_impl_item < ' ast : ' a > ( def_id : DefId ,
167+ item : & ' a hir:: ImplItem ,
168+ map : & hir_map:: Map < ' ast > )
169+ -> InlinedItemRef < ' a > {
158170 let ( body, kind) = match item. node {
159- hir:: ImplItemKind :: Method ( ref sig, body_id) => ( map. expr ( body_id) , InlinedItemKindRef :: Fn ( & sig. decl ) ) ,
171+ hir:: ImplItemKind :: Method ( ref sig, body_id) =>
172+ ( map. expr ( body_id) , InlinedItemKindRef :: Fn ( & sig. decl ) ) ,
160173 hir:: ImplItemKind :: Const ( ref ty, ref body) => ( & * * body, InlinedItemKindRef :: Const ( ty) ) ,
161174 _ => bug ! ( "InlinedItemRef::from_impl_item wrong kind" )
162175 } ;
0 commit comments