mirror of
https://github.com/italicsjenga/winit-sonoma-fix.git
synced 2024-12-24 22:31:30 +11:00
Merge pull request #315 from tomaka/size_hint
Redirect size_hint method to the underlying iterators
This commit is contained in:
commit
b4f8c3b959
|
@ -445,9 +445,14 @@ pub struct PollEventsIterator<'a>(winimpl::PollEventsIterator<'a>);
|
||||||
|
|
||||||
impl<'a> Iterator for PollEventsIterator<'a> {
|
impl<'a> Iterator for PollEventsIterator<'a> {
|
||||||
type Item = Event;
|
type Item = Event;
|
||||||
|
|
||||||
fn next(&mut self) -> Option<Event> {
|
fn next(&mut self) -> Option<Event> {
|
||||||
self.0.next()
|
self.0.next()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn size_hint(&self) -> (usize, Option<usize>) {
|
||||||
|
self.0.size_hint()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// An iterator for the `wait_events` function.
|
/// An iterator for the `wait_events` function.
|
||||||
|
@ -455,9 +460,14 @@ pub struct WaitEventsIterator<'a>(winimpl::WaitEventsIterator<'a>);
|
||||||
|
|
||||||
impl<'a> Iterator for WaitEventsIterator<'a> {
|
impl<'a> Iterator for WaitEventsIterator<'a> {
|
||||||
type Item = Event;
|
type Item = Event;
|
||||||
|
|
||||||
fn next(&mut self) -> Option<Event> {
|
fn next(&mut self) -> Option<Event> {
|
||||||
self.0.next()
|
self.0.next()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn size_hint(&self) -> (usize, Option<usize>) {
|
||||||
|
self.0.size_hint()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// An iterator for the list of available monitors.
|
/// An iterator for the list of available monitors.
|
||||||
|
@ -469,9 +479,14 @@ pub struct AvailableMonitorsIter {
|
||||||
|
|
||||||
impl Iterator for AvailableMonitorsIter {
|
impl Iterator for AvailableMonitorsIter {
|
||||||
type Item = MonitorID;
|
type Item = MonitorID;
|
||||||
|
|
||||||
fn next(&mut self) -> Option<MonitorID> {
|
fn next(&mut self) -> Option<MonitorID> {
|
||||||
self.data.next().map(|id| MonitorID(id))
|
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.
|
/// Returns the list of all available monitors.
|
||||||
|
|
Loading…
Reference in a new issue