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:
@@ -1,4 +1,5 @@
|
||||
use core::fmt;
|
||||
use std::any::Any;
|
||||
use std::error::Error;
|
||||
use std::hash::Hash;
|
||||
use std::ops::Deref;
|
||||
@@ -8,8 +9,6 @@ use std::time::Duration;
|
||||
#[doc(inline)]
|
||||
pub use cursor_icon::CursorIcon;
|
||||
|
||||
use crate::as_any::AsAny;
|
||||
|
||||
/// The maximum width and height for a cursor when using [`CustomCursorSource::from_rgba`].
|
||||
pub const MAX_CURSOR_SIZE: u16 = 2048;
|
||||
|
||||
@@ -79,7 +78,7 @@ impl From<CustomCursor> for Cursor {
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct CustomCursor(pub Arc<dyn CustomCursorProvider>);
|
||||
|
||||
pub trait CustomCursorProvider: AsAny + fmt::Debug + Send + Sync {
|
||||
pub trait CustomCursorProvider: Any + fmt::Debug + Send + Sync {
|
||||
/// Whether a cursor was backed by animation.
|
||||
fn is_animated(&self) -> bool;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user