diff options
author | tomaka <pierre.krieger1708@gmail.com> | 2015-03-16 21:04:30 +0100 |
---|---|---|
committer | tomaka <pierre.krieger1708@gmail.com> | 2015-03-16 21:04:30 +0100 |
commit | b4f8c3b959d56315697f22753536cbba54d98619 (patch) | |
tree | f672ba4f0ec4b93fc22d80f12b7d0155583290c5 /src | |
parent | b431ef55919048bdc56fb1071b04a374c7c9f769 (diff) | |
parent | daa086759cf290c49b308db20a41fb6c642d345a (diff) | |
download | glutin-b4f8c3b959d56315697f22753536cbba54d98619.tar.gz glutin-b4f8c3b959d56315697f22753536cbba54d98619.zip |
Merge pull request #315 from tomaka/size_hint
Redirect size_hint method to the underlying iterators
Diffstat (limited to 'src')
-rw-r--r-- | src/window.rs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/window.rs b/src/window.rs index bd5fc14..56af494 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<Event> { self.0.next() } + + fn size_hint(&self) -> (usize, Option<usize>) { + 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<Event> { self.0.next() } + + fn size_hint(&self) -> (usize, Option<usize>) { + 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<MonitorID> { self.data.next().map(|id| MonitorID(id)) } + + fn size_hint(&self) -> (usize, Option<usize>) { + self.data.size_hint() + } } /// Returns the list of all available monitors. |