Skip to main content

dizzy_macros/
lib.rs

1use proc_macro::TokenStream;
2use syn::{DeriveInput, parse_macro_input};
3
4mod dst_newtype;
5
6#[proc_macro_derive(DstNewtype, attributes(dizzy))]
7pub fn derive_dst_newtype(input: TokenStream) -> TokenStream {
8    let input = parse_macro_input!(input as DeriveInput);
9    dst_newtype::expand(input)
10        .unwrap_or_else(syn::Error::into_compile_error)
11        .into()
12}