New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor(lib): Switch from pin-project to pin-project-lite (again) #2566
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks so much, excellent work!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<3
Note the practical affects of this PR:
🎉 |
I'm actually a bit surprised about the dependency diff. pin-project should "only" pull in pin-project-internal > syn > quote > proc-macro2 > unicode-xid AFAICT. |
Hm, I think you're right. I just based that number off making a new crate, adding hyper as a dependency (to not get any dev-dependencies), and then recording how it says |
Ah, paying more attention, it's because the |
Will there be a patch release with this soon? |
Yep, just released v0.14.9. |
…2566) Note the practical affects of this change: - Dependency count with --features full dropped from 65 to 55. - Time to compile after a clean dropped from 48s to 35s (on a pretty underpowered VM). Closes hyperium#2388
This is another small step towards reducing the size of bollard's dependency tree :-) `tokio` and `hyper` have both switched from `pin-project` crate to the lighter-weight `pin-project-lite`: tokio-rs/tokio#1778 hyperium/hyper#2566 This does the same for bollard. For the differences between the two crates, see: https://docs.rs/pin-project-lite/0.2.8/pin_project_lite/#pin-project-vs-pin-project-lite Note: The full advantage of this won't be seen until a new `hyperlocal` release exists that contains: softprops/hyperlocal#54 ...and bollard updates to that release, so that `pin-project` can be fully dropped from the dependency tree.
Second try, turned out to require a bunch more changes in
src/client/conn.rs
andsrc/server/conn.rs
due to theProtoClient
andProtoServer
enums which previously hadcfg
-conditional variants (which aren't supported by pin-project-lite). Now the variants that previously were disabled bycfg(not(feature = "http1"))
andcfg(not(feature = "http2"))
are instead made to be uninhabited.The code would be a decent amount simpler if the non-exhaustive variants could be omitted in
match
es (rust-lang/rust#51085).