-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Currently, we use the `future::ready` and `future::poll_fn` functions and the `pin_mut!` macro from the `futures` crate. The equivalent APIs in libcore have stabilized, so we can use them instead. Because we use a bunch of other stuff from `futures` --- in particular, `futures::select!` --- this doesn't allow us to reduce our dependency footprint by removing dependencies on `futures`. But, IMO, it feels like sligly better style to use the standard library versions of common APIs when it's possible to do so. Also, I think the `core::pin::pin!` macro has a somewhat nicer API than `futures::pin_mut!` since it allows pinning the expression on the left-hand side of a `let` binding directly, rather than having to assign the value to a name and *then* pin it: ```rust // Personally, I think this: let mut pinned_fut = core::pin::pin!(future::ready()); pinned_fut.await; // ...looks nicer than this: let pinned_fut = future::ready(); pin_mut!(pinned_fut); pinned_fut.await; ```
- Loading branch information
Showing
5 changed files
with
8 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters