-
Notifications
You must be signed in to change notification settings - Fork 633
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
Add more optional features to the main futures crate #1875
Comments
Unfortunately, that doesn't work. Imagine you have this crate layout:
Let's suppose that crate A uses In that case all of the default features will be enabled, and there is nothing crates A or C can do about it. Some more context here. |
That’s absolutely fine, if |
Yes, that's exactly the problem. Every crate would need to use Unfortunately, it's far too easy to mess up So, as an alternative suggestion, what if nothing was enabled by default in [dependencies]
util = { version = "0.3.0", optional = true, package = "futures-util" }
core = { version = "0.3.0", optional = true, package = "futures-core" }
executor = { version = "0.3.0", optional = true, package = "futures-executor" }
[features]
all = ["core", "util", "executor"] This means you don't need to use |
FYI: It is impossible to add the "util" feature with the current crate-layout (because the |
Closing in favor of #2295. |
For convenience, the
futures
(well,futures-preview
for now) crate re-exports from all of the futures-*. This can be a nice first experience, being able to use streams, sinks, channels, and what-not out-of-the-box. However, due to this, other libraries have been removing their dependency onfutures
to a smaller group that they need (such asfutures-core
andfutures-util
).I think it could be useful if a library could depend on
futures
while disabling the pieces they don't need. So, like in hyper, it could havefutures = { version = "0.3", default-features = false, features = ["util"] }
.The text was updated successfully, but these errors were encountered: