From f21d1209aa576a3e597c100fa56afe554dc2babd Mon Sep 17 00:00:00 2001 From: 无限UCW Date: Fri, 12 Aug 2022 01:57:05 +0800 Subject: Relax `Fn` trait bounds in `Command` & `Action` --- native/src/command.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'native/src/command.rs') diff --git a/native/src/command.rs b/native/src/command.rs index b0b12805..3571efc4 100644 --- a/native/src/command.rs +++ b/native/src/command.rs @@ -36,7 +36,7 @@ impl Command { /// Creates a [`Command`] that performs the action of the given future. pub fn perform( future: impl Future + 'static + MaybeSend, - f: impl Fn(T) -> A + 'static + MaybeSend, + f: impl FnOnce(T) -> A + 'static + MaybeSend, ) -> Command { use iced_futures::futures::FutureExt; @@ -56,7 +56,7 @@ impl Command { /// Applies a transformation to the result of a [`Command`]. pub fn map( self, - f: impl Fn(T) -> A + 'static + MaybeSend + Sync + Clone, + f: impl FnMut(T) -> A + 'static + MaybeSend + Sync + Clone, ) -> Command where T: 'static, -- cgit