diff options
author | 2022-08-12 01:57:05 +0800 | |
---|---|---|
committer | 2022-08-12 01:57:05 +0800 | |
commit | f21d1209aa576a3e597c100fa56afe554dc2babd (patch) | |
tree | 3b5ebd93ceff1d6d3b7c62dc5eba44dacbf17fff /native/src/command.rs | |
parent | e209349c508fe67d4494cd512eb25899840a13fd (diff) | |
download | iced-f21d1209aa576a3e597c100fa56afe554dc2babd.tar.gz iced-f21d1209aa576a3e597c100fa56afe554dc2babd.tar.bz2 iced-f21d1209aa576a3e597c100fa56afe554dc2babd.zip |
Relax `Fn` trait bounds in `Command` & `Action`
Diffstat (limited to 'native/src/command.rs')
-rw-r--r-- | native/src/command.rs | 4 |
1 files changed, 2 insertions, 2 deletions
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<T> Command<T> { /// Creates a [`Command`] that performs the action of the given future. pub fn perform<A>( future: impl Future<Output = T> + 'static + MaybeSend, - f: impl Fn(T) -> A + 'static + MaybeSend, + f: impl FnOnce(T) -> A + 'static + MaybeSend, ) -> Command<A> { use iced_futures::futures::FutureExt; @@ -56,7 +56,7 @@ impl<T> Command<T> { /// Applies a transformation to the result of a [`Command`]. pub fn map<A>( self, - f: impl Fn(T) -> A + 'static + MaybeSend + Sync + Clone, + f: impl FnMut(T) -> A + 'static + MaybeSend + Sync + Clone, ) -> Command<A> where T: 'static, |