fix: properly unwrap errors
This commit is contained in:
parent
dc9cc7aaa6
commit
2ca99faef3
1 changed files with 4 additions and 1 deletions
|
@ -4,7 +4,10 @@ use syn::{parse_macro_input, spanned::Spanned};
|
|||
|
||||
#[proc_macro_derive(Relax, attributes(relax))]
|
||||
pub fn derive(input: proc_macro::TokenStream) -> proc_macro::TokenStream {
|
||||
derive_impl(parse_macro_input!(input)).unwrap().into()
|
||||
match derive_impl(parse_macro_input!(input)) {
|
||||
Ok(tokens) => tokens.into(),
|
||||
Err(error) => error.to_compile_error().into(),
|
||||
}
|
||||
}
|
||||
|
||||
fn derive_impl(input: syn::DeriveInput) -> syn::Result<TokenStream> {
|
||||
|
|
Loading…
Reference in a new issue