diff options
author | 2023-08-03 10:19:28 -0700 | |
---|---|---|
committer | 2023-10-18 17:34:16 -0500 | |
commit | e0233ebc3ce4791d094c52eeef81cce78b9bc578 (patch) | |
tree | 7bc8db4f66c43e39b4a47cc1c6a29edba96bdcc6 /runtime | |
parent | bc9bb28b1ccd1248d63ccdfef2f57d7aa837abbb (diff) | |
download | iced-e0233ebc3ce4791d094c52eeef81cce78b9bc578.tar.gz iced-e0233ebc3ce4791d094c52eeef81cce78b9bc578.tar.bz2 iced-e0233ebc3ce4791d094c52eeef81cce78b9bc578.zip |
Fix `Command<T>::perform` to return a `Command<T>`
This seems like clearly the correct thing to do here. If the type bound
on `Command` isn't specified, it makes no difference, since the generic
is inferred in a way that works with either definition. But this is
important if `Command<T>` is aliased with a concrete type.
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/src/command.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/runtime/src/command.rs b/runtime/src/command.rs index cd4c51ff..b74097bd 100644 --- a/runtime/src/command.rs +++ b/runtime/src/command.rs @@ -40,9 +40,9 @@ 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 FnOnce(T) -> A + 'static + MaybeSend, - ) -> Command<A> { + future: impl Future<Output = A> + 'static + MaybeSend, + f: impl FnOnce(A) -> T + 'static + MaybeSend, + ) -> Command<T> { use iced_futures::futures::FutureExt; Command::single(Action::Future(Box::pin(future.map(f)))) |