From 3e8fffa3161a3b52697473e98ede765341d08f09 Mon Sep 17 00:00:00 2001 From: Lennart <18233294+lennart-k@users.noreply.github.com> Date: Thu, 12 Jun 2025 16:07:32 +0200 Subject: [PATCH] Fix xml PropName such that the rename attribute also propagates to the prop name --- crates/xml/derive/src/xml_enum/impl_prop_name.rs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/crates/xml/derive/src/xml_enum/impl_prop_name.rs b/crates/xml/derive/src/xml_enum/impl_prop_name.rs index cee4b0c..469b7e6 100644 --- a/crates/xml/derive/src/xml_enum/impl_prop_name.rs +++ b/crates/xml/derive/src/xml_enum/impl_prop_name.rs @@ -92,10 +92,17 @@ impl Enum { let prop_name_variants = tagged_variants.iter().map(|variant| { let ident = &variant.variant.ident; + let xml_name = variant.xml_name(); if let Some(proptype) = &variant.attrs.prop { - quote! {#ident(#proptype)} + quote! { + #[xml(rename = #xml_name)] + #ident(#proptype) + } } else { - quote! {#ident} + quote! { + #[xml(rename = #xml_name)] + #ident + } } });