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.
This commit is contained in:
parent
bc9bb28b1c
commit
e0233ebc3c
1 changed files with 3 additions and 3 deletions
|
|
@ -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))))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue