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

Enabling the "std" feature always enables "serde" #72

Closed
davnavr opened this issue Jul 26, 2024 · 2 comments
Closed

Enabling the "std" feature always enables "serde" #72

davnavr opened this issue Jul 26, 2024 · 2 comments

Comments

@davnavr
Copy link

davnavr commented Jul 26, 2024

The "std" feature for string-interner currently always enables "serde" when it is enabled, because the Cargo.toml says:

std = ["serde/std"]

instead of the correct:

std = ["serde?/std"]

which enables the "std" feature for serde only when "serde" is already enabled.

This currently means dependents of string-interner that set default-features = false while also enabling the "std" feature (expecting to only enable support for std without serde) may unknowingly depend on serde, taking a small amount of disk space (though I barely noticed any impact on compile times).

My current workaround is simply not enabling the "std" feature, and from my cursory glance of the source code, no code in string-interner itself currently uses anything from std, so this isn't too big of an issue.

@Robbepop
Copy link
Owner

Great catch! I was not aware of std = ["serde?/std"] syntax. Can you open a PR?

@Robbepop
Copy link
Owner

Fixed in #73.

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

No branches or pull requests

2 participants