diff --git a/crates/bevy_ecs/src/event.rs b/crates/bevy_ecs/src/event.rs index 7bd966362a..7876eb4067 100644 --- a/crates/bevy_ecs/src/event.rs +++ b/crates/bevy_ecs/src/event.rs @@ -378,6 +378,10 @@ impl<'a, E: Event> Iterator for ManualEventIterator<'a, E> { self.iter.next().map(|(event, _)| event) } + fn count(self) -> usize { + self.iter.count() + } + fn size_hint(&self) -> (usize, Option) { self.iter.size_hint() } @@ -445,6 +449,11 @@ impl<'a, E: Event> Iterator for ManualEventIteratorWithId<'a, E> { } } + fn count(self) -> usize { + self.reader.last_event_count += self.unread; + self.unread + } + fn size_hint(&self) -> (usize, Option) { self.chain.size_hint() }