Skip to content

Commit

Permalink
Simplify a doc example for EventWriter (#7549)
Browse files Browse the repository at this point in the history
# Objective

Use the `World::send_event` method added in #5355 to simplify a doc example for `EventWriter`.
  • Loading branch information
JoJoJet committed Feb 7, 2023
1 parent 5581cfe commit 5d2cd08
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions crates/bevy_ecs/src/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -278,8 +278,7 @@ impl<'w, 's, E: Event> EventReader<'w, 's, E> {
/// // NOTE: the event won't actually be sent until commands get flushed
/// // at the end of the current stage.
/// commands.add(|w: &mut World| {
/// let mut events_resource = w.resource_mut::<Events<_>>();
/// events_resource.send(MyEvent);
/// w.send_event(MyEvent);
/// });
/// }
/// ```
Expand Down

0 comments on commit 5d2cd08

Please sign in to comment.