From 21e39360f76eba032358e395bb5e2478a14f12da Mon Sep 17 00:00:00 2001 From: Blazepaws <157802762+blazepaws@users.noreply.github.com> Date: Sun, 15 Sep 2024 16:24:04 +0200 Subject: [PATCH] Example for bevy_ecs::event::Events uses deprecated function get_reader (#15216) Fixes https://github.com/bevyengine/bevy/issues/15214 --- crates/bevy_ecs/src/event/collections.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/bevy_ecs/src/event/collections.rs b/crates/bevy_ecs/src/event/collections.rs index f14e348edc..ea203bdc46 100644 --- a/crates/bevy_ecs/src/event/collections.rs +++ b/crates/bevy_ecs/src/event/collections.rs @@ -45,7 +45,7 @@ use std::ops::{Deref, DerefMut}; /// /// // setup /// let mut events = Events::::default(); -/// let mut reader = events.get_reader(); +/// let mut cursor = events.get_cursor(); /// /// // run this once per update/frame /// events.update(); @@ -54,12 +54,12 @@ use std::ops::{Deref, DerefMut}; /// events.send(MyEvent { value: 1 }); /// /// // somewhere else: read the events -/// for event in reader.read(&events) { +/// for event in cursor.read(&events) { /// assert_eq!(event.value, 1) /// } /// /// // events are only processed once per reader -/// assert_eq!(reader.read(&events).count(), 0); +/// assert_eq!(cursor.read(&events).count(), 0); /// ``` /// /// # Details