Simplify a doc example for EventWriter (#7549)

# Objective

Use the `World::send_event` method added in #5355 to simplify a doc example for `EventWriter`.
This commit is contained in:
JoJoJet 2023-02-07 16:45:26 +00:00
parent 5581cfe0d1
commit 5d2cd08165

View File

@ -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);
/// });
/// }
/// ```