@@ -279,9 +279,7 @@ fn serialize_variant(
279279 ) ;
280280
281281 quote ! {
282- // The braces are unnecessary but quasi used to put them in. We
283- // can remove them separately from the syn conversion.
284- #type_ident:: #variant_ident( ref __simple_value) => { #block } ,
282+ #type_ident:: #variant_ident( ref __simple_value) => #block,
285283 }
286284 } ,
287285 Style :: Tuple => {
@@ -462,15 +460,11 @@ fn serialize_tuple_struct_visitor(
462460 }
463461
464462 let ser = quote ! {
465- // This line should end in a semicolon but quasi used to behave
466- // differently between skipped and non-skipped so I have
467- // preserved that behavior. We can update it separately from the
468- // syn conversion.
469- try!( _serializer. #func( & mut __serde_state, #field_expr) )
463+ try!( _serializer. #func( & mut __serde_state, #field_expr) ) ;
470464 } ;
471465
472466 match skip {
473- None => quote ! ( # ser; ) ,
467+ None => ser,
474468 Some ( skip) => quote ! ( if !#skip { #ser } ) ,
475469 }
476470 } )
@@ -505,15 +499,11 @@ fn serialize_struct_visitor(
505499 }
506500
507501 let ser = quote ! {
508- // This line should end in a semicolon but quasi used to behave
509- // differently between skipped and non-skipped so I have
510- // preserved that behavior. We can update it separately from the
511- // syn conversion.
512- try!( _serializer. #func( & mut __serde_state, #key_expr, #field_expr) )
502+ try!( _serializer. #func( & mut __serde_state, #key_expr, #field_expr) ) ;
513503 } ;
514504
515505 match skip {
516- None => quote ! ( # ser; ) ,
506+ None => ser,
517507 Some ( skip) => quote ! ( if !#skip { #ser } ) ,
518508 }
519509 } )
@@ -540,27 +530,25 @@ fn wrap_serialize_with(
540530 . build ( )
541531 . build ( ) ;
542532
543- quote ! {
544- {
545- struct __SerializeWith #wrapper_generics #where_clause {
546- value: & ' __a #field_ty,
547- phantom: :: std:: marker:: PhantomData <#item_ty>,
548- }
533+ quote ! ( {
534+ struct __SerializeWith #wrapper_generics #where_clause {
535+ value: & ' __a #field_ty,
536+ phantom: :: std:: marker:: PhantomData <#item_ty>,
537+ }
549538
550- impl #wrapper_generics _serde:: ser:: Serialize for #wrapper_ty #where_clause {
551- fn serialize<__S>( & self , __s: & mut __S) -> :: std:: result:: Result <( ) , __S:: Error >
552- where __S: _serde:: ser:: Serializer
553- {
554- #path( self . value, __s)
555- }
539+ impl #wrapper_generics _serde:: ser:: Serialize for #wrapper_ty #where_clause {
540+ fn serialize<__S>( & self , __s: & mut __S) -> :: std:: result:: Result <( ) , __S:: Error >
541+ where __S: _serde:: ser:: Serializer
542+ {
543+ #path( self . value, __s)
556544 }
545+ }
557546
558- __SerializeWith {
559- value: #value,
560- phantom: :: std:: marker:: PhantomData :: <#item_ty>,
561- }
547+ __SerializeWith {
548+ value: #value,
549+ phantom: :: std:: marker:: PhantomData :: <#item_ty>,
562550 }
563- }
551+ } )
564552}
565553
566554// Serialization of an empty struct results in code like:
0 commit comments