Skip to content

Commit

Permalink
Only use empty_object when tag is None
Browse files Browse the repository at this point in the history
  • Loading branch information
gustavo-shigueo committed Nov 25, 2024
1 parent f1ffff6 commit 212108a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion macros/src/types/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ fn type_def(attr: &StructAttr, ident: &str, fields: &Fields) -> Result<DerivedTS

match fields {
Fields::Named(named) => 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() {
Expand Down

0 comments on commit 212108a

Please sign in to comment.