mirror of
https://github.com/griffi-gh/hUI.git
synced 2024-11-29 02:18:40 -06:00
13 lines
338 B
Rust
13 lines
338 B
Rust
|
extern crate proc_macro;
|
||
|
|
||
|
use proc_macro::TokenStream;
|
||
|
use quote::quote;
|
||
|
use syn::{parse_macro_input, DeriveInput};
|
||
|
|
||
|
#[proc_macro_derive(Signal)]
|
||
|
pub fn signal(input: TokenStream) -> TokenStream {
|
||
|
let input = parse_macro_input!(input as DeriveInput);
|
||
|
let name = input.ident;
|
||
|
quote!(impl ::hui::signal::Signal for #name {}).into()
|
||
|
}
|