Relax Fn trait bounds in Command & Action

This commit is contained in:
无限UCW 2022-08-12 01:57:05 +08:00
parent e209349c50
commit f21d1209aa
No known key found for this signature in database
GPG key ID: E3AC4C8FACD6B47C
6 changed files with 12 additions and 12 deletions

View file

@ -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,