mirror of
https://github.com/rust-windowing/winit.git
synced 2026-06-27 23:23:14 -04:00
Use consistent return types for available_monitors() (#1207)
* [#1111] Use consistent return types for available_monitors() Always use `impl Iterator<Item = MonitorHandle>` instead of `AvailableMonitorsIter`. Fix an example that used the Debug implementation of `AvailableMonitorsIter`. * [#1111] Update changelog * [#1111] Remove AvailableMonitorsIter type completely * [#1111] Remove doc references to AvailableMonitorsIter
This commit is contained in:
@@ -5,7 +5,7 @@ use crate::{
|
||||
dpi::{LogicalPosition, LogicalSize},
|
||||
error::{ExternalError, NotSupportedError, OsError},
|
||||
event_loop::EventLoopWindowTarget,
|
||||
monitor::{AvailableMonitorsIter, MonitorHandle, VideoMode},
|
||||
monitor::{MonitorHandle, VideoMode},
|
||||
platform_impl,
|
||||
};
|
||||
|
||||
@@ -703,11 +703,11 @@ impl Window {
|
||||
///
|
||||
/// **iOS:** Can only be called on the main thread.
|
||||
#[inline]
|
||||
pub fn available_monitors(&self) -> AvailableMonitorsIter {
|
||||
let data = self.window.available_monitors();
|
||||
AvailableMonitorsIter {
|
||||
data: data.into_iter(),
|
||||
}
|
||||
pub fn available_monitors(&self) -> impl Iterator<Item = MonitorHandle> {
|
||||
self.window
|
||||
.available_monitors()
|
||||
.into_iter()
|
||||
.map(|inner| MonitorHandle { inner })
|
||||
}
|
||||
|
||||
/// Returns the primary monitor of the system.
|
||||
|
||||
Reference in New Issue
Block a user