test-vectors-macro 0.1.0

A proc macro to support the test-vectors crate
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#[derive(Debug, derive_more::From)]
pub(crate) enum Error {
    Syn(syn::Error),
    Darling(darling::Error),
}

pub(crate) type Result<T> = std::result::Result<T, Error>;

impl Error {
    pub(crate) fn into_compile_error(self) -> proc_macro2::TokenStream {
        use Error::*;

        match self {
            Syn(e) => e.into_compile_error(),
            Darling(e) => e.write_errors(),
        }
    }
}