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() {