Remove generic parameter T from EventLoopWindowTarget (#3298)

This commit is contained in:
Mads Marquart 2024-01-13 21:36:53 +01:00 committed by GitHub
parent 169cd39f93
commit 22311802b5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
37 changed files with 174 additions and 210 deletions

View file

@ -16,7 +16,7 @@ pub use proxy::EventLoopProxy;
pub use window_target::EventLoopWindowTarget;
pub struct EventLoop<T: 'static> {
elw: RootEventLoopWindowTarget<T>,
elw: RootEventLoopWindowTarget,
user_event_sender: Sender<T>,
user_event_receiver: Receiver<T>,
}
@ -40,7 +40,7 @@ impl<T> EventLoop<T> {
pub fn run<F>(self, mut event_handler: F) -> !
where
F: FnMut(Event<T>, &RootEventLoopWindowTarget<T>),
F: FnMut(Event<T>, &RootEventLoopWindowTarget),
{
let target = RootEventLoopWindowTarget {
p: self.elw.p.clone(),
@ -77,7 +77,7 @@ impl<T> EventLoop<T> {
pub fn spawn<F>(self, mut event_handler: F)
where
F: 'static + FnMut(Event<T>, &RootEventLoopWindowTarget<T>),
F: 'static + FnMut(Event<T>, &RootEventLoopWindowTarget),
{
let target = RootEventLoopWindowTarget {
p: self.elw.p.clone(),
@ -105,7 +105,7 @@ impl<T> EventLoop<T> {
EventLoopProxy::new(self.elw.p.waker(), self.user_event_sender.clone())
}
pub fn window_target(&self) -> &RootEventLoopWindowTarget<T> {
pub fn window_target(&self) -> &RootEventLoopWindowTarget {
&self.elw
}
}