num_enum icon indicating copy to clipboard operation
num_enum copied to clipboard

Allowing specifying the num_enum crate name when deriving TryFromPrimitive

Open yshui opened this issue 2 years ago • 1 comments

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.

yshui avatar Sep 12 '22 18:09 yshui

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

spearman avatar Jan 02 '23 14:01 spearman