Skip to content
Snippets Groups Projects
Verified Commit 071b535a authored by Louis's avatar Louis :fire:
Browse files

Bump version

parent 0ce86f7e
No related branches found
No related tags found
No related merge requests found
[package] [package]
name = "micro_games_macros" name = "micro_games_macros"
version = "0.3.1" version = "0.4.0"
edition = "2021" edition = "2021"
authors = ["Louis Capitanchik <contact@louiscap.co>"] authors = ["Louis Capitanchik <contact@louiscap.co>"]
description = "Utility macros to make it easier to build complex systems with Bevy" description = "Utility macros to make it easier to build complex systems with Bevy"
......
...@@ -55,24 +55,17 @@ fn define_structs(data: &DataEnum) -> TokenStream { ...@@ -55,24 +55,17 @@ fn define_structs(data: &DataEnum) -> TokenStream {
let event_name = ident_suffix(ident, "Event"); let event_name = ident_suffix(ident, "Event");
let fields: TokenStream = fields let fields: TokenStream = fields
.iter() .iter()
.map( .map(|fl @ Field { ident, ty, .. }| {
|fl @ Field { let f = Field {
ident, ident: ident.clone(),
ty, ty: ty.clone(),
mutability, vis: parse_quote!(pub),
.. ..fl.clone()
}| { }
let f = Field { .to_token_stream();
ident: ident.clone(),
ty: ty.clone(), quote!(#f,)
vis: parse_quote!(pub), })
..fl.clone()
}
.to_token_stream();
quote!(#f,)
},
)
.collect(); .collect();
quote! { quote! {
......
use micro_games_macros::event_system; use micro_games_macros::event_system;
use std::sync::Mutex;
#[test] #[test]
fn event_system_correctly_generates_and_dispatches_events() { fn event_system_correctly_generates_and_dispatches_events() {
...@@ -22,7 +22,7 @@ fn event_system_correctly_generates_and_dispatches_events() { ...@@ -22,7 +22,7 @@ fn event_system_correctly_generates_and_dispatches_events() {
app.add_plugins(MyEventsPlugin); app.add_plugins(MyEventsPlugin);
app.add_systems( app.add_systems(
Update, Update,
|mut has_run: ResMut<HasRun>, mut events: EventReader<WaitEvent>| { |mut has_run: ResMut<HasRun>, events: EventReader<WaitEvent>| {
has_run.0 = true; has_run.0 = true;
let event_length = events.len(); let event_length = events.len();
assert_eq!(event_length, 1); assert_eq!(event_length, 1);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment