File tree Expand file tree Collapse file tree 2 files changed +5
-7
lines changed Expand file tree Collapse file tree 2 files changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -209,7 +209,7 @@ pub fn get_item_attrs<F>(cstore: &cstore::CStore,
209209 F : FnOnce ( Vec < ast:: Attribute > ) ,
210210{
211211 let cdata = cstore. get_crate_data ( def_id. krate ) ;
212- decoder:: get_item_attrs ( & * cdata, def_id. node , f )
212+ f ( decoder:: get_item_attrs ( & * cdata, def_id. node ) ) ;
213213}
214214
215215pub fn get_struct_fields ( cstore : & cstore:: CStore ,
Original file line number Diff line number Diff line change @@ -1025,18 +1025,16 @@ pub fn get_tuple_struct_definition_if_ctor(cdata: Cmd,
10251025 ret
10261026}
10271027
1028- pub fn get_item_attrs < F > ( cdata : Cmd ,
1029- orig_node_id : ast:: NodeId ,
1030- f : F ) where
1031- F : FnOnce ( Vec < ast:: Attribute > ) ,
1032- {
1028+ pub fn get_item_attrs ( cdata : Cmd ,
1029+ orig_node_id : ast:: NodeId )
1030+ -> Vec < ast:: Attribute > {
10331031 // The attributes for a tuple struct are attached to the definition, not the ctor;
10341032 // we assume that someone passing in a tuple struct ctor is actually wanting to
10351033 // look at the definition
10361034 let node_id = get_tuple_struct_definition_if_ctor ( cdata, orig_node_id) ;
10371035 let node_id = node_id. map ( |x| x. node ) . unwrap_or ( orig_node_id) ;
10381036 let item = lookup_item ( node_id, cdata. data ( ) ) ;
1039- f ( get_attributes ( item) ) ;
1037+ get_attributes ( item)
10401038}
10411039
10421040pub fn get_struct_field_attrs ( cdata : Cmd ) -> HashMap < ast:: NodeId , Vec < ast:: Attribute > > {
You can’t perform that action at this time.
0 commit comments