Skip to content

chore: Remove futures crates#1478

Merged
LucioFranco merged 2 commits intohyperium:masterfrom
tottoto:remove-futures-crates
Aug 29, 2023
Merged

chore: Remove futures crates#1478
LucioFranco merged 2 commits intohyperium:masterfrom
tottoto:remove-futures-crates

Conversation

@tottoto
Copy link
Copy Markdown
Collaborator

@tottoto tottoto commented Aug 26, 2023

Motivation

Completes of removing futures crates.

Solution

  • Replaces futures_{core, util}::ready with std::task::ready, which was stabilized at Rust 1.64.
  • Uses pin_utils crate directly instead of via futures_util. (When tonic's MSRV be bumped to Rust 1.68 in the future, std::pin::pin can be used.)

tonic/Cargo.toml Outdated
base64 = "0.21"
bytes = "1.0"
futures-util = {version = "0.3", default-features = false}
pin-utils = "0.1"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For now, tokio has been used behind transport feature. To use tokio::pin macro, we have to use tokio throughout tonic implementations. I think tonic is mostly used with tokio so it seems not to be really matter. However, as I'm not sure whether it is appropriate to always depend on tokio only for using tokio::pin, I would like to hear your opinion.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we depend on tokio's default features (which should be basically empty) then it should be available and pretty light weight.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for reviews! I'll fix to use tokio.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

@tottoto tottoto force-pushed the remove-futures-crates branch from 7169064 to fb1cd13 Compare August 28, 2023 14:53
@LucioFranco
Copy link
Copy Markdown
Member

Thanks!

@LucioFranco LucioFranco added this pull request to the merge queue Aug 29, 2023
Merged via the queue into hyperium:master with commit 2325e32 Aug 29, 2023
@tottoto tottoto deleted the remove-futures-crates branch August 29, 2023 15:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants