mirror of
https://github.com/Noratrieb/game-wip-dontplay.git
synced 2026-01-14 11:45:01 +01:00
15 lines
459 B
Rust
15 lines
459 B
Rust
use proc_macro::TokenStream;
|
|
use quote::quote;
|
|
|
|
#[proc_macro_derive(Inspect)]
|
|
pub fn derive_inspect(input: TokenStream) -> TokenStream {
|
|
let expanded = quote! {
|
|
impl Inspect for GameState {
|
|
fn inspect_mut(&mut self) {
|
|
output_mut(|o| o.copied_text = format!(""));
|
|
output_mut(|o| o.copied_text = format!("{:?}", self.tile_db));
|
|
}
|
|
}
|
|
};
|
|
proc_macro::TokenStream::from(expanded)
|
|
}
|