File tree Expand file tree Collapse file tree 1 file changed +14
-13
lines changed
Expand file tree Collapse file tree 1 file changed +14
-13
lines changed Original file line number Diff line number Diff line change @@ -56,7 +56,6 @@ use std::borrow::Cow;
5656use std:: cell:: Cell ;
5757use std:: collections:: VecDeque ;
5858use std:: fmt:: Write ;
59- use std:: iter;
6059use std:: ops;
6160use std:: str:: FromStr ;
6261
@@ -1596,15 +1595,18 @@ impl<'a> FieldCodegen<'a> for BitfieldUnit {
15961595
15971596 let layout = self . layout ( ) ;
15981597 let unit_field_ty = helpers:: bitfield_unit ( ctx, layout) ;
1599- let field_ty = if parent. is_union ( ) {
1600- wrap_union_field_if_needed (
1601- ctx,
1602- struct_layout,
1603- unit_field_ty. clone ( ) ,
1604- result,
1605- )
1606- } else {
1607- unit_field_ty. clone ( )
1598+ let field_ty = {
1599+ let unit_field_ty = unit_field_ty. clone ( ) ;
1600+ if parent. is_union ( ) {
1601+ wrap_union_field_if_needed (
1602+ ctx,
1603+ struct_layout,
1604+ unit_field_ty,
1605+ result,
1606+ )
1607+ } else {
1608+ unit_field_ty
1609+ }
16081610 } ;
16091611
16101612 {
@@ -4236,13 +4238,12 @@ fn objc_method_codegen(
42364238 let fn_ret = utils:: fnsig_return_ty ( ctx, signature) ;
42374239
42384240 let sig = if method. is_class_method ( ) {
4239- let fn_args = fn_args. clone ( ) ;
42404241 quote ! {
42414242 ( #( #fn_args ) , * ) #fn_ret
42424243 }
42434244 } else {
4244- let fn_args = fn_args . clone ( ) ;
4245- let args = iter:: once ( quote ! { & self } ) . chain ( fn_args. into_iter ( ) ) ;
4245+ let self_arr = [ quote ! { & self } ] ;
4246+ let args = self_arr . iter ( ) . chain ( fn_args. iter ( ) ) ;
42464247 quote ! {
42474248 ( #( #args ) , * ) #fn_ret
42484249 }
You can’t perform that action at this time.
0 commit comments