File tree 1 file changed +14
-13
lines changed
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;
56
56
use std:: cell:: Cell ;
57
57
use std:: collections:: VecDeque ;
58
58
use std:: fmt:: Write ;
59
- use std:: iter;
60
59
use std:: ops;
61
60
use std:: str:: FromStr ;
62
61
@@ -1596,15 +1595,18 @@ impl<'a> FieldCodegen<'a> for BitfieldUnit {
1596
1595
1597
1596
let layout = self . layout ( ) ;
1598
1597
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
+ }
1608
1610
} ;
1609
1611
1610
1612
{
@@ -4236,13 +4238,12 @@ fn objc_method_codegen(
4236
4238
let fn_ret = utils:: fnsig_return_ty ( ctx, signature) ;
4237
4239
4238
4240
let sig = if method. is_class_method ( ) {
4239
- let fn_args = fn_args. clone ( ) ;
4240
4241
quote ! {
4241
4242
( #( #fn_args ) , * ) #fn_ret
4242
4243
}
4243
4244
} 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 ( ) ) ;
4246
4247
quote ! {
4247
4248
( #( #args ) , * ) #fn_ret
4248
4249
}
You can’t perform that action at this time.
0 commit comments