Fix xml PropName such that the rename attribute also propagates to the prop name

This commit is contained in:
Lennart
2025-06-12 16:07:32 +02:00
parent 40e7bc0f66
commit 3e8fffa316

View File

@@ -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
}
} }
}); });