File tree 3 files changed +6
-9
lines changed
3 files changed +6
-9
lines changed Original file line number Diff line number Diff line change @@ -157,17 +157,14 @@ impl EnumInfo {
157
157
. map ( |( index, variant) | ( variant. name ( ) , index) )
158
158
. collect :: < HashMap < _ , _ > > ( ) ;
159
159
160
- let variant_names = variants
161
- . iter ( )
162
- . map ( |variant| variant. name ( ) )
163
- . collect :: < Vec < _ > > ( ) ;
160
+ let variant_names = variants. iter ( ) . map ( |variant| variant. name ( ) ) . collect ( ) ;
164
161
165
162
Self {
166
163
name,
167
164
type_name : std:: any:: type_name :: < TEnum > ( ) ,
168
165
type_id : TypeId :: of :: < TEnum > ( ) ,
169
166
variants : variants. to_vec ( ) . into_boxed_slice ( ) ,
170
- variant_names : variant_names . into_boxed_slice ( ) ,
167
+ variant_names,
171
168
variant_indices,
172
169
#[ cfg( feature = "documentation" ) ]
173
170
docs : None ,
Original file line number Diff line number Diff line change @@ -99,11 +99,11 @@ impl StructVariantInfo {
99
99
/// Create a new [`StructVariantInfo`].
100
100
pub fn new ( name : & ' static str , fields : & [ NamedField ] ) -> Self {
101
101
let field_indices = Self :: collect_field_indices ( fields) ;
102
- let field_names = fields. iter ( ) . map ( |field| field. name ( ) ) . collect :: < Vec < _ > > ( ) ;
102
+ let field_names = fields. iter ( ) . map ( |field| field. name ( ) ) . collect ( ) ;
103
103
Self {
104
104
name,
105
105
fields : fields. to_vec ( ) . into_boxed_slice ( ) ,
106
- field_names : field_names . into_boxed_slice ( ) ,
106
+ field_names,
107
107
field_indices,
108
108
#[ cfg( feature = "documentation" ) ]
109
109
docs : None ,
Original file line number Diff line number Diff line change @@ -94,14 +94,14 @@ impl StructInfo {
94
94
. map ( |( index, field) | ( field. name ( ) , index) )
95
95
. collect :: < HashMap < _ , _ > > ( ) ;
96
96
97
- let field_names = fields. iter ( ) . map ( |field| field. name ( ) ) . collect :: < Vec < _ > > ( ) ;
97
+ let field_names = fields. iter ( ) . map ( |field| field. name ( ) ) . collect ( ) ;
98
98
99
99
Self {
100
100
name,
101
101
type_name : std:: any:: type_name :: < T > ( ) ,
102
102
type_id : TypeId :: of :: < T > ( ) ,
103
103
fields : fields. to_vec ( ) . into_boxed_slice ( ) ,
104
- field_names : field_names . into_boxed_slice ( ) ,
104
+ field_names,
105
105
field_indices,
106
106
#[ cfg( feature = "documentation" ) ]
107
107
docs : None ,
You can’t perform that action at this time.
0 commit comments