Skip to content
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

Merged
merged 1 commit into from
Sep 6, 2023

Conversation

nyurik
Copy link
Contributor

@nyurik nyurik commented Sep 1, 2023

  • Make sure all optional dependencies are not exposed automatically, but rather explicit

@nyurik nyurik requested a review from a team as a code owner September 1, 2023 04:04
embedded-hal-bus/Cargo.toml Outdated Show resolved Hide resolved
@@ -14,6 +14,7 @@ categories = [
[features]
std = ["alloc"]
alloc = []
defmt-03 = ["dep:defmt-03"]
Copy link
Member

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?

Copy link
Contributor Author

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" :)

Copy link
Member

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
Copy link
Member

@eldruin eldruin left a 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"]
Copy link
Member

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.

@eldruin eldruin added this pull request to the merge queue Sep 6, 2023
Merged via the queue into rust-embedded:master with commit 030a232 Sep 6, 2023
12 checks passed
@nyurik nyurik deleted the cargo-fixes branch September 6, 2023 13:35
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.

3 participants