traitful 0.3.0

A collection of helper macros for trait patterns
Documentation
1
2
3
4
5
6
7
use proc_macro2::TokenStream;
use syn::Result;

/// Unwrap the result and properly handle the error
pub(crate) fn unwrap(result: Result<TokenStream>) -> proc_macro::TokenStream {
    result.unwrap_or_else(|e| e.into_compile_error()).into()
}