From b328da2c71e998e539bdc65815061e88dd1e7081 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Fri, 14 Jun 2024 01:52:30 +0200 Subject: Fix `Send` requirements for Wasm targets --- core/src/widget/operation.rs | 4 ++-- runtime/src/task.rs | 2 +- runtime/src/window.rs | 6 +++--- winit/src/application.rs | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/core/src/widget/operation.rs b/core/src/widget/operation.rs index 1fa924a4..3e4ed618 100644 --- a/core/src/widget/operation.rs +++ b/core/src/widget/operation.rs @@ -8,7 +8,7 @@ pub use scrollable::Scrollable; pub use text_input::TextInput; use crate::widget::Id; -use crate::{MaybeSend, Rectangle, Vector}; +use crate::{Rectangle, Vector}; use std::any::Any; use std::fmt; @@ -16,7 +16,7 @@ use std::sync::Arc; /// A piece of logic that can traverse the widget tree of an application in /// order to query or update some widget state. -pub trait Operation: MaybeSend { +pub trait Operation: Send { /// Operates on a widget that contains other widgets. /// /// The `operate_on_children` function can be called to return control to diff --git a/runtime/src/task.rs b/runtime/src/task.rs index ac28a4e7..f3ddbca1 100644 --- a/runtime/src/task.rs +++ b/runtime/src/task.rs @@ -52,7 +52,7 @@ impl Task { /// its output. pub fn widget(operation: impl widget::Operation + 'static) -> Task where - T: MaybeSend + 'static, + T: Send + 'static, { Self::channel(move |sender| { let operation = diff --git a/runtime/src/window.rs b/runtime/src/window.rs index 0876ab69..59f285fd 100644 --- a/runtime/src/window.rs +++ b/runtime/src/window.rs @@ -7,7 +7,7 @@ use crate::core::time::Instant; use crate::core::window::{ Event, Icon, Id, Level, Mode, Settings, UserAttention, }; -use crate::core::{MaybeSend, Point, Size}; +use crate::core::{Point, Size}; use crate::futures::event; use crate::futures::futures::channel::oneshot; use crate::futures::Subscription; @@ -303,10 +303,10 @@ pub fn change_icon(id: Id, icon: Icon) -> Task { /// Note that if the window closes before this call is processed the callback will not be run. pub fn run_with_handle( id: Id, - f: impl FnOnce(WindowHandle<'_>) -> T + MaybeSend + 'static, + f: impl FnOnce(WindowHandle<'_>) -> T + Send + 'static, ) -> Task where - T: MaybeSend + 'static, + T: Send + 'static, { Task::oneshot(move |channel| { crate::Action::Window(Action::RunWithHandle( diff --git a/winit/src/application.rs b/winit/src/application.rs index a08c2010..a93878ea 100644 --- a/winit/src/application.rs +++ b/winit/src/application.rs @@ -202,7 +202,7 @@ where #[cfg(target_arch = "wasm32")] is_booted: std::rc::Rc>, #[cfg(target_arch = "wasm32")] - queued_events: Vec>, + queued_events: Vec>>, } struct BootConfig { -- cgit