You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
FutureExt provides our familiar .then, .and_then, .map etc.
However, after switching to std::future::Future, in many places we can switch directly to using async/async move block, or async function (when lifetimes of arguments are not a problem)
In practice, it might be able to save us some unnecessary clones and make the code more readable and tidy.
For new contributors who want to work on this:
Search in the codebase the keyword FutureExt, especially many files under cli/ops/.... Try replacing some places where .then/.and_then/.map etc. is used with a complete async block which returns a future.
FutureExt
provides our familiar.then
,.and_then
,.map
etc.However, after switching to
std::future::Future
, in many places we can switch directly to usingasync/async move
block, orasync
function (when lifetimes of arguments are not a problem)In practice, it might be able to save us some unnecessary clones and make the code more readable and tidy.
A demo of such refactoring is #3359
The text was updated successfully, but these errors were encountered: