This commit is contained in:
nora 2023-04-18 21:07:04 +02:00
parent 98730fcab1
commit accbdc83bf
2 changed files with 7 additions and 7 deletions

View file

@ -4,12 +4,8 @@ use quote::quote;
#[proc_macro] #[proc_macro]
pub fn expand(_: TokenStream) -> TokenStream { pub fn expand(_: TokenStream) -> TokenStream {
quote! { quote! {
impl GameState { output_mut(|o| o.copied_text = "".into());
fn inspect_mut(&mut self) { output_mut(|o| o.copied_text = format!("{:?}", self.tile_db));
output_mut(|o| o.copied_text = "".into());
output_mut(|o| o.copied_text = format!("{:?}", self.tile_db));
}
}
} }
.into() .into()
} }

View file

@ -11,7 +11,11 @@ pub(crate) struct GameState {
pub(crate) tile_db: TileDb, pub(crate) tile_db: TileDb,
} }
expand! {} impl GameState {
fn inspect_mut(&mut self) {
expand! {}
}
}
fn new() -> GameState { fn new() -> GameState {
loop {} loop {}