mirror of
https://github.com/rust-windowing/winit.git
synced 2026-06-27 15:13:13 -04:00
Web: async improvements (#3805)
- Internal: Fix dropping `Notifier` without sending a result causing `Future`s to never complete. This should never happen anyway, but now we get a panic instead of nothing if we hit a bug. - Internal: Remove a bunch of `unwrap()`s that aren't required when correctly using `MainThreadMarker`. - `Window::canvas()` is now able to return a reference instead of an owned value. Extracted from #3801.
This commit is contained in:
@@ -1,15 +1,13 @@
|
||||
use std::rc::Weak;
|
||||
|
||||
use super::runner::Execution;
|
||||
use super::runner::WeakShared;
|
||||
use crate::platform_impl::platform::r#async::Waker;
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct EventLoopProxy {
|
||||
runner: Waker<Weak<Execution>>,
|
||||
runner: Waker<WeakShared>,
|
||||
}
|
||||
|
||||
impl EventLoopProxy {
|
||||
pub fn new(runner: Waker<Weak<Execution>>) -> Self {
|
||||
pub fn new(runner: Waker<WeakShared>) -> Self {
|
||||
Self { runner }
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user