Closed spearman closed 1 year ago
At the moment, you can add a derive feature to strum to import both strum and the macros
[dependencies]
strum = { version="0.24", features=["derive"] }
They could probably be one crate, but serde uses the pattern above so that's the route I opted for as well. As a minor benefit, it means that if you're using a derive macro that doesn't reference any of strum
's traits, you don't need to reference strum itself anywhere. Only strum_macros
.
That's perfect, that's how serde does it. Looks like the feature was mentioned in the readme but I overlooked it. I'll go ahead and close this.
It would be slightly nicer to only need to add a single dependency. As it is now, to use
strum_macros
you must importstrum
anyway (so it seems). Other crates that provide similar macros don't require depending on separate macro/trait crates (examples are theenum-iterator
crate and theparse-display
crate), although they do include a procedural macros crate as a dependency of the main crate. Just a suggestion for future versions. Feel free to close this issue if you feel it's not relevant.