Skip to content

Commit 5889238

Browse files
committed
allow more kinds of empty structs
1 parent 5fbf326 commit 5889238

File tree

1 file changed

+1
-1
lines changed
  • crates/bevy_macro_utils/src

1 file changed

+1
-1
lines changed

crates/bevy_macro_utils/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ pub fn derive_label(
158158
}
159159
// Structs must either be fieldless, or explicitly ignore the fields.
160160
let ignore_fields = input.attrs.iter().any(|a| is_ignore(a, attr_name));
161-
if matches!(d.fields, syn::Fields::Unit) || ignore_fields {
161+
if d.fields.is_empty() || ignore_fields {
162162
let lit = ident.to_string();
163163
let data = quote! { 0 };
164164
let as_str = quote! { write!(f, #lit) };

0 commit comments

Comments
 (0)