-
Notifications
You must be signed in to change notification settings - Fork 212
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
Cleanup Cargo features and optionals #494
Conversation
nyurik
commented
Sep 1, 2023
- Make sure all optional dependencies are not exposed automatically, but rather explicit
@@ -14,6 +14,7 @@ categories = [ | |||
[features] | |||
std = ["alloc"] | |||
alloc = [] | |||
defmt-03 = ["dep:defmt-03"] |
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.
IIUC this is equivalent to the old code. Why is it better?
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.
I believe this is better because it makes defmt-03
feature declaration explicit for anyone looking at cargo.toml -- one can see all features at a glance. It also means that if additional dependencies are needed for the defmt-03
feature, they can be simply listed at the end of the list. In short, I prefer this form simply to follow Rust-way of "no implicit surprises" :)
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.
A bit redundant but I sympathize with the case of seeing all features at a glance.
* Make sure all optional dependencies are not exposed automatically, but rather explicit
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.
Seems fine to me now, thanks!
@@ -14,6 +14,7 @@ categories = [ | |||
[features] | |||
std = ["alloc"] | |||
alloc = [] | |||
defmt-03 = ["dep:defmt-03"] |
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.
A bit redundant but I sympathize with the case of seeing all features at a glance.