From a7c5493ddc970965d7d7305e1c926bc26ba89eb5 Mon Sep 17 00:00:00 2001 From: akimakinai <105044389+akimakinai@users.noreply.github.com> Date: Sat, 25 Nov 2023 21:38:01 +0900 Subject: [PATCH] Manual `impl Default` for EventTrigger --- src/trigger.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/trigger.rs b/src/trigger.rs index abd3268..681de79 100644 --- a/src/trigger.rs +++ b/src/trigger.rs @@ -292,7 +292,7 @@ impl DoneTrigger { } /// Trigger that transitions when it receives the associated event -#[derive(Debug, Default, Clone, Copy)] +#[derive(Debug, Clone, Copy)] pub struct EventTrigger(PhantomData); impl OptionTrigger for EventTrigger { @@ -308,6 +308,13 @@ impl OptionTrigger for EventTrigger { } } +// derive(Default) requires `T: Default` +impl Default for EventTrigger { + fn default() -> Self { + Self(PhantomData) + } +} + pub(crate) fn remove_done_markers(mut commands: Commands, dones: Query>) { for done in &dones { commands.entity(done).remove::();