Closed ExpHP closed 6 years ago
Oh interesting; I didn't know about these guidelines. Definitely a good idea to follow the convention.
For the sake of being tiringly explicit, it looks like we need to:
serde
dependency behind a derive
featureserde
as a feature flag.I wonder if we should add mention this in the README as well.
Nah, you just remove serde_derive
as a dependency, and enable the derive
feature on your serde dependency. (and don't set up any feature explicitly for serde). Users of frunk don't need to worry/know about this derive
thing.
If you do this, then the only feature exposed by frunk will be called serde (it will be the feature autogenerated by cargo because serde is an optional dep)
But yes I do think you should mention something in the readme. (The user needs to add features =. ["serde"]
to their frunk
dep to get serde derives.)
If you do this, then the only feature exposed by frunk will be called serde (it will be the feature autogenerated by cargo because serde is an optional dep)
Oh nice; didn't know this was possible 😎
See C-SERDE in the Rust API guidelines
Note it is not actually possible to name a feature the same as a dependency. Rather,
serde
provides a"derive"
feature specifically for this purpose.