@@ -121,7 +121,7 @@ impl IntrinsicTypeDefinition for ArmIntrinsicType {
121
121
}
122
122
}
123
123
124
- fn from_c ( s : & str , target : & str ) -> Result < Box < Self > , String > {
124
+ fn from_c ( s : & str , target : & str ) -> Result < Self , String > {
125
125
const CONST_STR : & str = "const" ;
126
126
if let Some ( s) = s. strip_suffix ( '*' ) {
127
127
let ( s, constant) = match s. trim ( ) . strip_suffix ( CONST_STR ) {
@@ -131,9 +131,8 @@ impl IntrinsicTypeDefinition for ArmIntrinsicType {
131
131
let s = s. trim_end ( ) ;
132
132
let temp_return = ArmIntrinsicType :: from_c ( s, target) ;
133
133
temp_return. map ( |mut op| {
134
- let edited = op. as_mut ( ) ;
135
- edited. 0 . ptr = true ;
136
- edited. 0 . ptr_constant = constant;
134
+ op. ptr = true ;
135
+ op. ptr_constant = constant;
137
136
op
138
137
} )
139
138
} else {
@@ -163,7 +162,7 @@ impl IntrinsicTypeDefinition for ArmIntrinsicType {
163
162
) ,
164
163
None => None ,
165
164
} ;
166
- Ok ( Box :: new ( ArmIntrinsicType ( IntrinsicType {
165
+ Ok ( ArmIntrinsicType ( IntrinsicType {
167
166
ptr : false ,
168
167
ptr_constant : false ,
169
168
constant,
@@ -172,14 +171,14 @@ impl IntrinsicTypeDefinition for ArmIntrinsicType {
172
171
simd_len,
173
172
vec_len,
174
173
target : target. to_string ( ) ,
175
- } ) ) )
174
+ } ) )
176
175
} else {
177
176
let kind = start. parse :: < TypeKind > ( ) ?;
178
177
let bit_len = match kind {
179
178
TypeKind :: Int ( _) => Some ( 32 ) ,
180
179
_ => None ,
181
180
} ;
182
- Ok ( Box :: new ( ArmIntrinsicType ( IntrinsicType {
181
+ Ok ( ArmIntrinsicType ( IntrinsicType {
183
182
ptr : false ,
184
183
ptr_constant : false ,
185
184
constant,
@@ -188,7 +187,7 @@ impl IntrinsicTypeDefinition for ArmIntrinsicType {
188
187
simd_len : None ,
189
188
vec_len : None ,
190
189
target : target. to_string ( ) ,
191
- } ) ) )
190
+ } ) )
192
191
}
193
192
}
194
193
}
0 commit comments