chore: improve error span

This commit is contained in:
naskya 2024-07-16 16:40:18 +09:00
parent 2ca99faef3
commit dfbd2b3457
Signed by: naskya
GPG key ID: 712D413B3A9FED5C

View file

@ -19,13 +19,13 @@ fn derive_impl(input: syn::DeriveInput) -> syn::Result<TokenStream> {
if relax_attrs.is_empty() {
return Err(syn::Error::new_spanned(
input,
input.ident,
"expected #[relax(StructName)] attrubute",
));
}
if relax_attrs.len() > 1 {
return Err(syn::Error::new_spanned(
input,
input.ident,
"expected only one #[relax(StructName)] attrubute on top of the struct",
));
}