Properly implement event loop extension traits

This was implemented for `&dyn ActiveEventLoop` before, but that's less
general than implementing it directly for `dyn ActiveEventLoop`.

The `+ '_` is required to tell the compiler that we want to implement
this for all `dyn ActiveEventLoop`s, not just `'static` ones (even
though they're all going to be `'static`).
This commit is contained in:
Mads Marquart 2024-08-11 18:33:12 +02:00 committed by GitHub
parent 70c54ee0ff
commit 038ef5c3ad
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 6 additions and 6 deletions

View file

@ -91,7 +91,7 @@ pub trait ActiveEventLoopExtX11 {
fn is_x11(&self) -> bool;
}
impl ActiveEventLoopExtX11 for &dyn ActiveEventLoop {
impl ActiveEventLoopExtX11 for dyn ActiveEventLoop + '_ {
#[inline]
fn is_x11(&self) -> bool {
self.as_any().downcast_ref::<crate::platform_impl::x11::ActiveEventLoop>().is_some()