string-interner icon indicating copy to clipboard operation
string-interner copied to clipboard

Enabling the "std" feature always enables "serde"

Open davnavr opened this issue 1 year ago • 1 comments

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.

davnavr avatar Jul 26 '24 01:07 davnavr

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

Robbepop avatar Jul 26 '24 09:07 Robbepop

Fixed in #73.

Robbepop avatar Nov 12 '24 22:11 Robbepop