From e3273d6172be9001c69fd292ab68c37e824f48a5 Mon Sep 17 00:00:00 2001 From: Wolfgang Bumiller Date: Thu, 8 Aug 2019 13:13:35 +0200 Subject: [PATCH] formatting cleanup Signed-off-by: Wolfgang Bumiller --- proxmox-api-macro/src/api_macro.rs | 37 ++++++++++++++---------------- 1 file changed, 17 insertions(+), 20 deletions(-) diff --git a/proxmox-api-macro/src/api_macro.rs b/proxmox-api-macro/src/api_macro.rs index 4ec3e3cf..840d30b2 100644 --- a/proxmox-api-macro/src/api_macro.rs +++ b/proxmox-api-macro/src/api_macro.rs @@ -470,18 +470,21 @@ fn handle_newtype( let apidef = ParameterDefinition::from_object(definition)?; - let impl_verify = struct_fields_impl_verify(item.span(), &[StructField { - def: apidef, - ident: None, - access: syn::Member::Unnamed(syn::Index { - index: 0, - span: type_ident.span(), - }), - mem_id: 0, - string: "0".to_string(), - strlit: syn::LitStr::new("0", type_ident.span()), - ty: &field.ty, - }])?; + let impl_verify = struct_fields_impl_verify( + item.span(), + &[StructField { + def: apidef, + ident: None, + access: syn::Member::Unnamed(syn::Index { + index: 0, + span: type_ident.span(), + }), + mem_id: 0, + string: "0".to_string(), + strlit: syn::LitStr::new("0", type_ident.span()), + ty: &field.ty, + }], + )?; let (impl_serialize, impl_deserialize) = if serialize_as_string { let expected = format!("valid {}", type_ident); @@ -525,10 +528,7 @@ fn handle_newtype( }) } -fn newtype_derive_serialize( - span: Span, - type_ident: &Ident, -) -> TokenStream { +fn newtype_derive_serialize(span: Span, type_ident: &Ident) -> TokenStream { quote_spanned! { span => impl ::serde::ser::Serialize for #type_ident { fn serialize(&self, serializer: S) -> ::std::result::Result @@ -541,10 +541,7 @@ fn newtype_derive_serialize( } } -fn newtype_derive_deserialize( - span: Span, - type_ident: &Ident, -) -> TokenStream { +fn newtype_derive_deserialize(span: Span, type_ident: &Ident) -> TokenStream { quote_spanned! { span => impl<'de> ::serde::de::Deserialize<'de> for #type_ident { fn deserialize(deserializer: D) -> ::std::result::Result