Relax FnMut to FnOnce in app::edit_schedule (#8982)

# 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`
This commit is contained in:
Nuutti Kotivuori 2023-06-29 03:26:34 +03:00 committed by GitHub
parent 9237778e14
commit ab3b429211
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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>();