Clean up macro code a bit

This commit is contained in:
Joscha 2023-04-27 20:36:00 +02:00
parent 6f85995379
commit 15177a529a
2 changed files with 3 additions and 3 deletions

View file

@ -17,7 +17,7 @@ fn decapitalize(s: &str) -> String {
pub fn derive_impl(input: DeriveInput) -> syn::Result<TokenStream> {
let Data::Struct(data) = input.data else {
return Err(syn::Error::new(input.span(), "Must be a struct"));
return util::bail(input.span(), "Must be a struct");
};
let struct_ident = input.ident;