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,
209
209
F : FnOnce ( Vec < ast:: Attribute > ) ,
210
210
{
211
211
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 ) ) ;
213
213
}
214
214
215
215
pub 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,
1025
1025
ret
1026
1026
}
1027
1027
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 > {
1033
1031
// The attributes for a tuple struct are attached to the definition, not the ctor;
1034
1032
// we assume that someone passing in a tuple struct ctor is actually wanting to
1035
1033
// look at the definition
1036
1034
let node_id = get_tuple_struct_definition_if_ctor ( cdata, orig_node_id) ;
1037
1035
let node_id = node_id. map ( |x| x. node ) . unwrap_or ( orig_node_id) ;
1038
1036
let item = lookup_item ( node_id, cdata. data ( ) ) ;
1039
- f ( get_attributes ( item) ) ;
1037
+ get_attributes ( item)
1040
1038
}
1041
1039
1042
1040
pub 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