Skip to content

Commit

Permalink
Remove closure
Browse files Browse the repository at this point in the history
  • Loading branch information
Alice Cecile committed Jan 12, 2024
1 parent a5a69ea commit eaad8ac
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions crates/bevy_time/src/common_conditions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,8 @@ pub fn repeating_after_real_delay(
/// .add_systems(
/// Update,
/// (
/// is_paused.run_if(paused()),
/// not_paused.run_if(not(paused())),
/// is_paused.run_if(paused),
/// not_paused.run_if(not(paused)),
/// )
/// )
/// .run();
Expand All @@ -231,8 +231,8 @@ pub fn repeating_after_real_delay(
/// // ran when time is not paused
/// }
/// ```
pub fn paused() -> impl FnMut(Res<Time<Virtual>>) -> bool + Clone {
move |time: Res<Time<Virtual>>| time.is_paused()
pub fn paused(time: Res<Time<Virtual>>) -> bool {
time.is_paused()
}

#[cfg(test)]
Expand All @@ -249,7 +249,7 @@ mod tests {
Schedule::default().add_systems(
(test_system, test_system)
.distributive_run_if(on_timer(Duration::new(1, 0)))
.distributive_run_if(paused()),
.distributive_run_if(paused),
);
}
}

0 comments on commit eaad8ac

Please sign in to comment.