diff --git a/src/window.rs b/src/window.rs index bd5fc14f..56af4942 100644 --- a/src/window.rs +++ b/src/window.rs @@ -445,9 +445,14 @@ pub struct PollEventsIterator<'a>(winimpl::PollEventsIterator<'a>); impl<'a> Iterator for PollEventsIterator<'a> { type Item = Event; + fn next(&mut self) -> Option { self.0.next() } + + fn size_hint(&self) -> (usize, Option) { + self.0.size_hint() + } } /// An iterator for the `wait_events` function. @@ -455,9 +460,14 @@ pub struct WaitEventsIterator<'a>(winimpl::WaitEventsIterator<'a>); impl<'a> Iterator for WaitEventsIterator<'a> { type Item = Event; + fn next(&mut self) -> Option { self.0.next() } + + fn size_hint(&self) -> (usize, Option) { + self.0.size_hint() + } } /// An iterator for the list of available monitors. @@ -469,9 +479,14 @@ pub struct AvailableMonitorsIter { impl Iterator for AvailableMonitorsIter { type Item = MonitorID; + fn next(&mut self) -> Option { self.data.next().map(|id| MonitorID(id)) } + + fn size_hint(&self) -> (usize, Option) { + self.data.size_hint() + } } /// Returns the list of all available monitors.