Skip to content

Commit

Permalink
fix doctest
Browse files Browse the repository at this point in the history
  • Loading branch information
JoJoJet committed Feb 7, 2024
1 parent 8b0d3a8 commit 38ba4e6
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions crates/bevy_ecs/src/world/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1889,27 +1889,25 @@ 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)
/// });
///
/// // End the loop when the closure returns `ControlFlow::Break`.
/// 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| {
Expand Down

0 comments on commit 38ba4e6

Please sign in to comment.