@@ -83,7 +83,8 @@ fn gen_clone_impl(adt: &ast::Adt, func: &ast::Fn) -> Option<()> {
83
83
}
84
84
let pat = make:: tuple_struct_pat ( variant_name. clone ( ) , pats. into_iter ( ) ) ;
85
85
let struct_name = make:: expr_path ( variant_name) ;
86
- let tuple_expr = make:: expr_call ( struct_name, make:: arg_list ( fields) ) ;
86
+ let tuple_expr =
87
+ make:: expr_call ( struct_name, make:: arg_list ( fields) ) . into ( ) ;
87
88
arms. push ( make:: match_arm ( pat. into ( ) , None , tuple_expr) ) ;
88
89
}
89
90
@@ -126,7 +127,7 @@ fn gen_clone_impl(adt: &ast::Adt, func: &ast::Fn) -> Option<()> {
126
127
fields. push ( gen_clone_call ( target) ) ;
127
128
}
128
129
let struct_name = make:: expr_path ( make:: ext:: ident_path ( "Self" ) ) ;
129
- make:: expr_call ( struct_name, make:: arg_list ( fields) )
130
+ make:: expr_call ( struct_name, make:: arg_list ( fields) ) . into ( )
130
131
}
131
132
// => Self { }
132
133
None => {
@@ -303,7 +304,7 @@ fn gen_debug_impl(adt: &ast::Adt, func: &ast::Fn) -> Option<()> {
303
304
fn gen_default_impl ( adt : & ast:: Adt , func : & ast:: Fn ) -> Option < ( ) > {
304
305
fn gen_default_call ( ) -> Option < ast:: Expr > {
305
306
let fn_name = make:: ext:: path_from_idents ( [ "Default" , "default" ] ) ?;
306
- Some ( make:: expr_call ( make:: expr_path ( fn_name) , make:: arg_list ( None ) ) )
307
+ Some ( make:: expr_call ( make:: expr_path ( fn_name) , make:: arg_list ( None ) ) . into ( ) )
307
308
}
308
309
match adt {
309
310
// `Debug` cannot be derived for unions, so no default impl can be provided.
@@ -330,7 +331,7 @@ fn gen_default_impl(adt: &ast::Adt, func: &ast::Fn) -> Option<()> {
330
331
. fields ( )
331
332
. map ( |_| gen_default_call ( ) )
332
333
. collect :: < Option < Vec < ast:: Expr > > > ( ) ?;
333
- make:: expr_call ( struct_name, make:: arg_list ( fields) )
334
+ make:: expr_call ( struct_name, make:: arg_list ( fields) ) . into ( )
334
335
}
335
336
None => {
336
337
let struct_name = make:: ext:: ident_path ( "Self" ) ;
@@ -364,7 +365,7 @@ fn gen_hash_impl(adt: &ast::Adt, func: &ast::Fn) -> Option<()> {
364
365
let fn_name = make_discriminant ( ) ?;
365
366
366
367
let arg = make:: expr_path ( make:: ext:: ident_path ( "self" ) ) ;
367
- let fn_call = make:: expr_call ( fn_name, make:: arg_list ( Some ( arg) ) ) ;
368
+ let fn_call = make:: expr_call ( fn_name, make:: arg_list ( Some ( arg) ) ) . into ( ) ;
368
369
let stmt = gen_hash_call ( fn_call) ;
369
370
370
371
make:: block_expr ( Some ( stmt) , None ) . indent ( ast:: edit:: IndentLevel ( 1 ) )
@@ -447,9 +448,11 @@ fn gen_partial_eq(adt: &ast::Adt, func: &ast::Fn, trait_ref: Option<TraitRef>) -
447
448
ast:: Adt :: Enum ( enum_) => {
448
449
// => std::mem::discriminant(self) == std::mem::discriminant(other)
449
450
let lhs_name = make:: expr_path ( make:: ext:: ident_path ( "self" ) ) ;
450
- let lhs = make:: expr_call ( make_discriminant ( ) ?, make:: arg_list ( Some ( lhs_name. clone ( ) ) ) ) ;
451
+ let lhs = make:: expr_call ( make_discriminant ( ) ?, make:: arg_list ( Some ( lhs_name. clone ( ) ) ) )
452
+ . into ( ) ;
451
453
let rhs_name = make:: expr_path ( make:: ext:: ident_path ( "other" ) ) ;
452
- let rhs = make:: expr_call ( make_discriminant ( ) ?, make:: arg_list ( Some ( rhs_name. clone ( ) ) ) ) ;
454
+ let rhs = make:: expr_call ( make_discriminant ( ) ?, make:: arg_list ( Some ( rhs_name. clone ( ) ) ) )
455
+ . into ( ) ;
453
456
let eq_check =
454
457
make:: expr_bin_op ( lhs, BinaryOp :: CmpOp ( CmpOp :: Eq { negated : false } ) , rhs) ;
455
458
0 commit comments