Skip to content

Commit

Permalink
Implement Clone for ManualEventReader
Browse files Browse the repository at this point in the history
  • Loading branch information
james7132 committed Mar 29, 2024
1 parent f0de762 commit 0d83ff8
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions crates/bevy_ecs/src/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -614,6 +614,15 @@ impl<E: Event> Default for ManualEventReader<E> {
}
}

impl<E: Event> Clone for ManualEventReader<E> {
fn clone(&self) -> Self {
ManualEventReader {
last_event_count: self.last_event_count,
_marker: PhantomData,
}
}
}

#[allow(clippy::len_without_is_empty)] // Check fails since the is_empty implementation has a signature other than `(&self) -> bool`
impl<E: Event> ManualEventReader<E> {
/// See [`EventReader::read`]
Expand Down

0 comments on commit 0d83ff8

Please sign in to comment.