mirror of
https://github.com/lennart-k/rustical.git
synced 2025-12-13 22:52:22 +00:00
xml: Fix serialization of unit variants
This commit is contained in:
@@ -199,9 +199,13 @@ impl Variant {
|
||||
}
|
||||
Fields::Unit => {
|
||||
quote! {
|
||||
if let Self::#ident = self {
|
||||
::rustical_xml::XmlSerialize::serialize(&(), ns, tag, writer)?;
|
||||
}
|
||||
if let Self::#ident = &self {
|
||||
if !enum_untagged {
|
||||
::rustical_xml::XmlSerialize::serialize(&(), None, Some(#variant_name), writer)?;
|
||||
} else {
|
||||
::rustical_xml::XmlSerialize::serialize(&(), None, None, writer)?;
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user