num_enum
num_enum copied to clipboard
Allowing specifying the num_enum crate name when deriving TryFromPrimitive
Useful when num_enum is being reexported from another crate, because otherwise I get:
Warning: Could not find `num_enum` in `dependencies` or `dev-dependencies` in `Cargo.toml`!
=> defaulting to `num_enum`
And compile fails.
For example, serde accepts a #[serde(crate = "")]
attribute for this.
num-derive also has a similar attribute so it can find the num_traits crate as a different identifier: https://docs.rs/num-derive/0.3.3/num_derive/#explicit-import