Skip to content

Commit

Permalink
Relax FnMut to FnOnce in app::edit_schedule (#8982)
Browse files Browse the repository at this point in the history
# Objective

Currently `App::edit_schedule` takes in `impl FnMut(&mut Schedule)`, but
it calls the function only once. It is probably the intention has been
to have it take `FnOnce` instead.

## Solution

- Relax the parameter to take `FnOnce` instead of `FnMut`
  • Loading branch information
nakedible authored Jun 29, 2023
1 parent 9237778 commit ab3b429
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crates/bevy_app/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -946,7 +946,7 @@ impl App {
pub fn edit_schedule(
&mut self,
label: impl ScheduleLabel,
mut f: impl FnMut(&mut Schedule),
f: impl FnOnce(&mut Schedule),
) -> &mut Self {
let mut schedules = self.world.resource_mut::<Schedules>();

Expand Down

0 comments on commit ab3b429

Please sign in to comment.