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
refactor(lib): drop futures-util except in ffi (hyperium#3890)
Make hyper usable for h1/h2 and client/server without this heavyweight
dependency. It's about 17k lines of code and takes up to 1.7 seconds to
compile on my machine, but hyper is only using a tiny fraction of it.
Larger applications probably still pull in futures-util by other means,
but it's no longer as unavoidable as in the early days of the ecosystem.
To remove futures-util without raising MSRV, I took these steps:
* When futures-util just re-exports something from its dependencies,
use it directly from the source.
* Inline trivial helpers like `poll_unpin` that "only" communicate
intent a little better but don't save any significant amount of code.
* Refactor the h2 client code to avoid `StreamFuture` for the "Client
has been dropped" detection -- just poll the mpsc channel directly.
* Implement a couple of small helpers from scratch when they're
straightforward and fit on one screen each. The majority of this is
polyfills for standard library APIs that would require a higher MSRV.
* Use `AtomicWaker` from the `atomic-waker` crate, a separately
published copy of the futures-util type of the same name. While the
two crates are owned by different organizations (smol-rs vs.
rust-lang), it's mostly the same people maintaining both copies.
The uses of future-util in hyper's tests/benches/examples and in the
`ffi` module seem much harder to remove entirely, so I did not touch
those modules at all.
0 commit comments