From 212108aa2ee391e7de72b4cde98bb8c7a05c8ff3 Mon Sep 17 00:00:00 2001 From: gustavo-shigueo Date: Mon, 25 Nov 2024 13:10:20 -0300 Subject: [PATCH] Only use empty_object when tag is None --- macros/src/types/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/macros/src/types/mod.rs b/macros/src/types/mod.rs index b22ebb3c..50bf3c4f 100644 --- a/macros/src/types/mod.rs +++ b/macros/src/types/mod.rs @@ -37,7 +37,7 @@ fn type_def(attr: &StructAttr, ident: &str, fields: &Fields) -> Result match named.named.len() { - 0 => unit::empty_object(attr, &name), + 0 if attr.tag.is_none() => unit::empty_object(attr, &name), _ => named::named(attr, &name, named), }, Fields::Unnamed(unnamed) => match unnamed.unnamed.len() {