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:
parent
4f6ca8792c
commit
55640a91ae
5 changed files with 15 additions and 50 deletions
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue