Skip to content

Commit

Permalink
Fix typo in derive macro
Browse files Browse the repository at this point in the history
Revert "Use add_system_to_schedule internally to reduce risk of bugs"

This reverts commit d2f508b94cc83a862ac65fff2d44745f74b9743c.
  • Loading branch information
alice-i-cecile committed Jan 24, 2023
1 parent d0a80d8 commit 83db16e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions crates/bevy_app/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -381,11 +381,11 @@ impl App {
pub fn add_system_to_schedule<P>(
&mut self,
system: impl IntoSystemConfig<P>,
schedule_label: impl ScheduleLabel,
schedule_label: &impl ScheduleLabel,
) -> &mut Self {
let mut schedules = self.world.resource_mut::<Schedules>();

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.")
Expand All @@ -398,11 +398,11 @@ impl App {
pub fn add_systems_to_schedule<P>(
&mut self,
systems: impl IntoSystemConfigs<P>,
schedule_label: impl ScheduleLabel,
schedule_label: &impl ScheduleLabel,
) -> &mut Self {
let mut schedules = self.world.resource_mut::<Schedules>();

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.")
Expand Down Expand Up @@ -430,7 +430,7 @@ impl App {
/// .add_startup_system(my_startup_system);
/// ```
pub fn add_startup_system<P>(&mut self, system: impl IntoSystemConfig<P>) -> &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`].
Expand All @@ -455,7 +455,7 @@ impl App {
/// );
/// ```
pub fn add_startup_systems<P>(&mut self, systems: impl IntoSystemConfigs<P>) -> &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`].
Expand Down
2 changes: 1 addition & 1 deletion crates/bevy_utils/src/label.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ macro_rules! define_boxed_label {
}
}

impl $label_trait_name for Box<dyn $label_trait_namel> {
impl $label_trait_name for Box<dyn $label_trait_name> {
fn dyn_clone(&self) -> Box<dyn $label_trait_name> {
// Be explicit that we want to use the inner value
// to avoid infinite recursion.
Expand Down

0 comments on commit 83db16e

Please sign in to comment.