From 90afd1db8df17a7afa06b521ccd52455eced9277 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Fri, 28 Jan 2022 21:45:30 +0700 Subject: Use `MaybeSend` in `perform` and `map` for `Command` --- native/src/command.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'native/src/command.rs') diff --git a/native/src/command.rs b/native/src/command.rs index 6fe518d7..89d0f045 100644 --- a/native/src/command.rs +++ b/native/src/command.rs @@ -3,6 +3,8 @@ mod action; pub use action::Action; +use iced_futures::MaybeSend; + use std::fmt; use std::future::Future; @@ -24,8 +26,8 @@ impl Command { /// Creates a [`Command`] that performs the action of the given future. pub fn perform( - future: impl Future + 'static + Send, - f: impl Fn(T) -> A + 'static + Send, + future: impl Future + 'static + MaybeSend, + f: impl Fn(T) -> A + 'static + MaybeSend, ) -> Command { use iced_futures::futures::FutureExt; @@ -45,7 +47,7 @@ impl Command { /// Applies a transformation to the result of a [`Command`]. pub fn map( self, - f: impl Fn(T) -> A + 'static + Send + Sync + Clone, + f: impl Fn(T) -> A + 'static + MaybeSend + Sync + Clone, ) -> Command where T: 'static, -- cgit