Skip to content

Commit 476e296

Browse files
authored
Implement Clone for ManualEventReader (#12777)
# Objective Fix #12764. ## Solution Implement Clone for the type.
1 parent e62a01f commit 476e296

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

crates/bevy_ecs/src/event.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -614,6 +614,15 @@ impl<E: Event> Default for ManualEventReader<E> {
614614
}
615615
}
616616

617+
impl<E: Event> Clone for ManualEventReader<E> {
618+
fn clone(&self) -> Self {
619+
ManualEventReader {
620+
last_event_count: self.last_event_count,
621+
_marker: PhantomData,
622+
}
623+
}
624+
}
625+
617626
#[allow(clippy::len_without_is_empty)] // Check fails since the is_empty implementation has a signature other than `(&self) -> bool`
618627
impl<E: Event> ManualEventReader<E> {
619628
/// See [`EventReader::read`]

0 commit comments

Comments
 (0)