chore: use our own AsAny to provide &dyn Any

This removes the direct requirement to implement `as_any` and it could
be just derived.

Also implement HasDisplayHandle for dyn ActiveEventLoop + '_.

Suggested-by: daxpedda <daxpedda@gmail.com>
This commit is contained in:
Kirill Chibisov 2024-08-11 21:24:34 +03:00 committed by GitHub
parent 038ef5c3ad
commit 3392e9c1de
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 27 additions and 46 deletions

View file

@ -1,4 +1,3 @@
use std::any::Any;
use std::cell::Cell;
use std::hash::Hash;
use std::num::{NonZeroU16, NonZeroU32};
@ -640,10 +639,6 @@ impl RootActiveEventLoop for ActiveEventLoop {
RootOwnedDisplayHandle { platform: OwnedDisplayHandle }
}
fn as_any(&self) -> &dyn Any {
self
}
#[cfg(feature = "rwh_06")]
fn rwh_06_handle(&self) -> &dyn rwh_06::HasDisplayHandle {
self