From 83db16e2a87b4ed7da71be33ae261cae18692056 Mon Sep 17 00:00:00 2001 From: Alice Cecile Date: Tue, 24 Jan 2023 10:19:41 -0500 Subject: [PATCH] Fix typo in derive macro Revert "Use add_system_to_schedule internally to reduce risk of bugs" This reverts commit d2f508b94cc83a862ac65fff2d44745f74b9743c. --- crates/bevy_app/src/app.rs | 12 ++++++------ crates/bevy_utils/src/label.rs | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/crates/bevy_app/src/app.rs b/crates/bevy_app/src/app.rs index dc2de4cb72520..6661a4d046657 100644 --- a/crates/bevy_app/src/app.rs +++ b/crates/bevy_app/src/app.rs @@ -381,11 +381,11 @@ impl App { pub fn add_system_to_schedule

( &mut self, system: impl IntoSystemConfig

, - schedule_label: impl ScheduleLabel, + schedule_label: &impl ScheduleLabel, ) -> &mut Self { let mut schedules = self.world.resource_mut::(); - if let Some(schedule) = schedules.get_mut(&schedule_label) { + if let Some(schedule) = schedules.get_mut(schedule_label) { schedule.add_system(system); } else { panic!("Provided schedule {schedule_label:?} does not exist.") @@ -398,11 +398,11 @@ impl App { pub fn add_systems_to_schedule

( &mut self, systems: impl IntoSystemConfigs

, - schedule_label: impl ScheduleLabel, + schedule_label: &impl ScheduleLabel, ) -> &mut Self { let mut schedules = self.world.resource_mut::(); - if let Some(schedule) = schedules.get_mut(&schedule_label) { + if let Some(schedule) = schedules.get_mut(schedule_label) { schedule.add_systems(systems); } else { panic!("Provided schedule {schedule_label:?} does not exist.") @@ -430,7 +430,7 @@ impl App { /// .add_startup_system(my_startup_system); /// ``` pub fn add_startup_system

(&mut self, system: impl IntoSystemConfig

) -> &mut Self { - self.add_system_to_schedule(system, CoreSchedule::Startup) + self.add_system_to_schedule(system, &CoreSchedule::Startup) } /// Adds a collection of systems to [`CoreSchedule::Startup`]. @@ -455,7 +455,7 @@ impl App { /// ); /// ``` pub fn add_startup_systems

(&mut self, systems: impl IntoSystemConfigs

) -> &mut Self { - self.add_systems_to_schedule(systems, CoreSchedule::Startup) + self.add_systems_to_schedule(systems, &CoreSchedule::Startup) } /// Adds standardized schedules and labels to an [`App`]. diff --git a/crates/bevy_utils/src/label.rs b/crates/bevy_utils/src/label.rs index 1a39102fdcdf1..631ef7a426245 100644 --- a/crates/bevy_utils/src/label.rs +++ b/crates/bevy_utils/src/label.rs @@ -99,7 +99,7 @@ macro_rules! define_boxed_label { } } - impl $label_trait_name for Box { + impl $label_trait_name for Box { fn dyn_clone(&self) -> Box { // Be explicit that we want to use the inner value // to avoid infinite recursion.