mirror of
https://github.com/lennart-k/rustical.git
synced 2025-12-13 18:12:27 +00:00
Fix xml PropName such that the rename attribute also propagates to the prop name
This commit is contained in:
@@ -92,10 +92,17 @@ impl Enum {
|
|||||||
|
|
||||||
let prop_name_variants = tagged_variants.iter().map(|variant| {
|
let prop_name_variants = tagged_variants.iter().map(|variant| {
|
||||||
let ident = &variant.variant.ident;
|
let ident = &variant.variant.ident;
|
||||||
|
let xml_name = variant.xml_name();
|
||||||
if let Some(proptype) = &variant.attrs.prop {
|
if let Some(proptype) = &variant.attrs.prop {
|
||||||
quote! {#ident(#proptype)}
|
quote! {
|
||||||
|
#[xml(rename = #xml_name)]
|
||||||
|
#ident(#proptype)
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
quote! {#ident}
|
quote! {
|
||||||
|
#[xml(rename = #xml_name)]
|
||||||
|
#ident
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user