Deno: Move away from excessive use of `FutureExt`

Created on 17 Nov 2019  路  3Comments  路  Source: denoland/deno

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.

A demo of such refactoring is #3359

Most helpful comment

FYI I'm working on update to tokio 0.2 which will should remove a few of these usages.

All 3 comments

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.

FYI I'm working on update to tokio 0.2 which will should remove a few of these usages.

I think we can close this issue now, we're left with around 20 imports of FutureExt 馃憤

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kitsonk picture kitsonk  路  3Comments

watilde picture watilde  路  3Comments

benjamingr picture benjamingr  路  3Comments

sh7dm picture sh7dm  路  3Comments

somombo picture somombo  路  3Comments