Rename operation::chain to then
... and make `focus_*` operations generic over the output type.
This commit is contained in:
parent
cfd2e7b116
commit
515772c9f8
2 changed files with 12 additions and 6 deletions
|
|
@ -295,7 +295,7 @@ where
|
|||
|
||||
/// Chains the output of an [`Operation`] with the provided function to
|
||||
/// build a new [`Operation`].
|
||||
pub fn chain<A, B, O>(
|
||||
pub fn then<A, B, O>(
|
||||
operation: impl Operation<A> + 'static,
|
||||
f: fn(A) -> O,
|
||||
) -> impl Operation<B>
|
||||
|
|
@ -361,7 +361,7 @@ where
|
|||
Outcome::Chain(Box::new((self.next)(value)))
|
||||
}
|
||||
Outcome::Chain(operation) => {
|
||||
Outcome::Chain(Box::new(chain(operation, self.next)))
|
||||
Outcome::Chain(Box::new(then(operation, self.next)))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue