From 38ba4e6028a4e95551a88d4dca37517cb00fbccb Mon Sep 17 00:00:00 2001 From: Joseph <21144246+JoJoJet@users.noreply.github.com> Date: Tue, 6 Feb 2024 21:59:55 -0800 Subject: [PATCH] fix doctest --- crates/bevy_ecs/src/world/mod.rs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/crates/bevy_ecs/src/world/mod.rs b/crates/bevy_ecs/src/world/mod.rs index e39f5abcfa3844..e4c45d2b69081e 100644 --- a/crates/bevy_ecs/src/world/mod.rs +++ b/crates/bevy_ecs/src/world/mod.rs @@ -1889,8 +1889,12 @@ impl World { /// /// // Repeatedly run the update function until it requests a break. /// loop { - /// // Update once. /// let control_flow = world.last_change_tick_scope(last_change_tick, |world| { + /// // Increment the change tick so we can detect changes from the previous update. + /// last_change_tick = world.change_tick(); + /// world.increment_change_tick(); + /// + /// // Update once. /// update_fn(world) /// }); /// @@ -1898,18 +1902,12 @@ impl World { /// if control_flow.is_break() { /// break; /// } - /// - /// // Increment the change tick so the next update can detect changes from this update. - /// last_change_tick = world.change_tick(); - /// world.increment_change_tick(); /// } /// } /// # /// # #[derive(Resource)] struct Count(u32); /// # let mut world = World::new(); /// # world.insert_resource(Count(0)); - /// # world.increment_change_tick(); - /// # /// # let saved_last_tick = world.last_change_tick(); /// # let mut num_updates = 0; /// # update_loop(&mut world, |world| {