mirror of
https://github.com/rust-windowing/winit.git
synced 2026-08-29 04:40:04 -04:00
Remove the AsAny helper trait
Trait upcasting (rust-lang/rust#65991) is stable since Rust 1.86, which is already the MSRV, so dyn trait objects coerce to dyn Any directly. Traits that needed AsAny now list Any as their supertrait, and the as_any module is renamed to casting as only the impl_dyn_casting macro remains.
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
//! methods, which return an iterator of [`MonitorHandle`]:
|
||||
//! - [`ActiveEventLoop::available_monitors`][crate::event_loop::ActiveEventLoop::available_monitors].
|
||||
//! - [`Window::available_monitors`][crate::window::Window::available_monitors].
|
||||
use std::any::Any;
|
||||
use std::borrow::Cow;
|
||||
use std::fmt;
|
||||
use std::num::{NonZeroU16, NonZeroU32};
|
||||
@@ -13,8 +14,6 @@ use std::sync::Arc;
|
||||
|
||||
use dpi::{PhysicalPosition, PhysicalSize};
|
||||
|
||||
use crate::as_any::AsAny;
|
||||
|
||||
/// Handle to a monitor.
|
||||
///
|
||||
/// Allows you to retrieve basic information and metadata about a monitor.
|
||||
@@ -54,7 +53,7 @@ impl PartialEq for MonitorHandle {
|
||||
impl Eq for MonitorHandle {}
|
||||
|
||||
/// Provider of the [`MonitorHandle`].
|
||||
pub trait MonitorHandleProvider: AsAny + fmt::Debug + Send + Sync {
|
||||
pub trait MonitorHandleProvider: Any + fmt::Debug + Send + Sync {
|
||||
/// Identifier for this monitor.
|
||||
///
|
||||
/// The representation of this modifier is not guaranteed and should be used only to compare
|
||||
|
||||
Reference in New Issue
Block a user