diff options
author | 2024-06-14 01:52:30 +0200 | |
---|---|---|
committer | 2024-06-14 01:52:30 +0200 | |
commit | b328da2c71e998e539bdc65815061e88dd1e7081 (patch) | |
tree | 0dbd05ccffd9a771e46e653ec4c364bf1e65cc8c | |
parent | a25b1af45690bdd8e1cbb20ee3a5b1c4342de455 (diff) | |
download | iced-b328da2c71e998e539bdc65815061e88dd1e7081.tar.gz iced-b328da2c71e998e539bdc65815061e88dd1e7081.tar.bz2 iced-b328da2c71e998e539bdc65815061e88dd1e7081.zip |
Fix `Send` requirements for Wasm targets
-rw-r--r-- | core/src/widget/operation.rs | 4 | ||||
-rw-r--r-- | runtime/src/task.rs | 2 | ||||
-rw-r--r-- | runtime/src/window.rs | 6 | ||||
-rw-r--r-- | 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<T>: MaybeSend { +pub trait Operation<T>: 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<T> Task<T> { /// its output. pub fn widget(operation: impl widget::Operation<T> + 'static) -> Task<T> 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<T>(id: Id, icon: Icon) -> Task<T> { /// Note that if the window closes before this call is processed the callback will not be run. pub fn run_with_handle<T>( id: Id, - f: impl FnOnce(WindowHandle<'_>) -> T + MaybeSend + 'static, + f: impl FnOnce(WindowHandle<'_>) -> T + Send + 'static, ) -> Task<T> 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<std::cell::RefCell<bool>>, #[cfg(target_arch = "wasm32")] - queued_events: Vec<winit::event::Event<Message>>, + queued_events: Vec<winit::event::Event<Action<Message>>>, } struct BootConfig<C> { |