dizzy-macros 0.2.0

Proc macros for the dizzy crate
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
use proc_macro::TokenStream;
use syn::{DeriveInput, parse_macro_input};

mod dst_newtype;

#[proc_macro_derive(DstNewtype, attributes(dizzy))]
pub fn derive_dst_newtype(input: TokenStream) -> TokenStream {
    let input = parse_macro_input!(input as DeriveInput);
    dst_newtype::expand(input)
        .unwrap_or_else(syn::Error::into_compile_error)
        .into()
}