diff options
Diffstat (limited to 'azalea-protocol/azalea-protocol-macros/src')
| -rwxr-xr-x | azalea-protocol/azalea-protocol-macros/src/lib.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/azalea-protocol/azalea-protocol-macros/src/lib.rs b/azalea-protocol/azalea-protocol-macros/src/lib.rs index 0c072b84..756d0d82 100755 --- a/azalea-protocol/azalea-protocol-macros/src/lib.rs +++ b/azalea-protocol/azalea-protocol-macros/src/lib.rs @@ -12,7 +12,8 @@ fn as_packet_derive(input: TokenStream, state: proc_macro2::TokenStream) -> Toke let syn::Data::Struct(syn::DataStruct { fields, .. }) = &data else { panic!("#[derive(*Packet)] can only be used on structs") }; - let syn::Fields::Named(_) = fields else { + + let (syn::Fields::Named(_) | syn::Fields::Unit) = fields else { panic!("#[derive(*Packet)] can only be used on structs with named fields") }; let variant_name = variant_name_from(&ident); |
