Implement Clone for ManualEventReader (#12777)

# Objective
Fix #12764.

## Solution
Implement Clone for the type.
This commit is contained in:
James Liu 2024-03-29 07:49:13 -07:00 committed by GitHub
parent e62a01f403
commit 476e296561
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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`]