Fix formatting
This commit is contained in:
parent
55c7c5db99
commit
0be3c92d27
|
@ -30,7 +30,6 @@ pub fn from_xml(input: proc_macro::TokenStream) -> proc_macro::TokenStream {
|
||||||
|
|
||||||
struct ContainerMeta<'input> {
|
struct ContainerMeta<'input> {
|
||||||
input: &'input DeriveInput,
|
input: &'input DeriveInput,
|
||||||
|
|
||||||
ns: NamespaceMeta,
|
ns: NamespaceMeta,
|
||||||
rename: Option<Literal>,
|
rename: Option<Literal>,
|
||||||
rename_all: RenameRule,
|
rename_all: RenameRule,
|
||||||
|
@ -161,7 +160,6 @@ impl VariantMeta {
|
||||||
for (item, span) in meta_items(&input.attrs) {
|
for (item, span) in meta_items(&input.attrs) {
|
||||||
match item {
|
match item {
|
||||||
MetaItem::Rename(lit) => rename = Some(lit.to_token_stream()),
|
MetaItem::Rename(lit) => rename = Some(lit.to_token_stream()),
|
||||||
|
|
||||||
MetaItem::Attribute => {
|
MetaItem::Attribute => {
|
||||||
return Err(syn::Error::new(
|
return Err(syn::Error::new(
|
||||||
span,
|
span,
|
||||||
|
|
|
@ -26,11 +26,10 @@ pub fn to_xml(input: &syn::DeriveInput) -> proc_macro2::TokenStream {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[rustfmt::skip]
|
|
||||||
fn serialize_enum(
|
fn serialize_enum(
|
||||||
input: &syn::DeriveInput,
|
input: &syn::DeriveInput,
|
||||||
data: &syn::DataEnum,
|
data: &syn::DataEnum,
|
||||||
meta: ContainerMeta
|
meta: ContainerMeta,
|
||||||
) -> TokenStream {
|
) -> TokenStream {
|
||||||
let ident = &input.ident;
|
let ident = &input.ident;
|
||||||
let mut variants = TokenStream::new();
|
let mut variants = TokenStream::new();
|
||||||
|
@ -39,7 +38,7 @@ fn serialize_enum(
|
||||||
let v_ident = &variant.ident;
|
let v_ident = &variant.ident;
|
||||||
let meta = match VariantMeta::from_variant(variant, &meta) {
|
let meta = match VariantMeta::from_variant(variant, &meta) {
|
||||||
Ok(meta) => meta,
|
Ok(meta) => meta,
|
||||||
Err(err) => return err.to_compile_error()
|
Err(err) => return err.to_compile_error(),
|
||||||
};
|
};
|
||||||
|
|
||||||
let serialize_as = meta.serialize_as;
|
let serialize_as = meta.serialize_as;
|
||||||
|
@ -47,7 +46,6 @@ fn serialize_enum(
|
||||||
}
|
}
|
||||||
|
|
||||||
let (impl_generics, ty_generics, where_clause) = input.generics.split_for_impl();
|
let (impl_generics, ty_generics, where_clause) = input.generics.split_for_impl();
|
||||||
|
|
||||||
quote!(
|
quote!(
|
||||||
impl #impl_generics ToXml for #ident #ty_generics #where_clause {
|
impl #impl_generics ToXml for #ident #ty_generics #where_clause {
|
||||||
fn serialize<W: ::core::fmt::Write + ?::core::marker::Sized>(
|
fn serialize<W: ::core::fmt::Write + ?::core::marker::Sized>(
|
||||||
|
|
Loading…
Reference in New Issue