errorx-macros 0.0.1

macros for the errorx crate.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use quote::quote;

pub fn render(input: &syn::DeriveInput, _: &syn::DataEnum) -> proc_macro2::TokenStream {
    let name = &input.ident;

    return quote! {
        impl std::error::Error for #name {
            fn source(&self) -> Option<&(dyn ::std::error::Error + 'static)> {
                return None;
            }
        }
    };
}