mirror of
https://github.com/lennart-k/rustical.git
synced 2026-01-31 01:58:23 +00:00
some changes to rustical_xml
This commit is contained in:
@@ -3,7 +3,7 @@ use syn::{parse_macro_input, DeriveInput};
|
||||
|
||||
mod de;
|
||||
|
||||
use de::{impl_de_enum, impl_de_struct};
|
||||
use de::{impl_de_enum, NamedStruct};
|
||||
|
||||
#[proc_macro_derive(XmlDeserialize, attributes(xml))]
|
||||
pub fn derive_xml_deserialize(input: proc_macro::TokenStream) -> proc_macro::TokenStream {
|
||||
@@ -11,7 +11,7 @@ pub fn derive_xml_deserialize(input: proc_macro::TokenStream) -> proc_macro::Tok
|
||||
|
||||
match &input.data {
|
||||
syn::Data::Enum(e) => impl_de_enum(&input, e),
|
||||
syn::Data::Struct(s) => impl_de_struct(&input, s),
|
||||
syn::Data::Struct(s) => NamedStruct::parse(&input, s).impl_de(),
|
||||
syn::Data::Union(_) => panic!("Union not supported"),
|
||||
}
|
||||
.into()
|
||||
|
||||
Reference in New Issue
Block a user