num-derive
num-derive copied to clipboard
num-derive doesn't know how to handle newtypes with named fields yet.
I'm using bindgen
to create a enum, here is the generated code.
#[repr(u32)]
#[non_exhaustive]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq, FromPrimitive)]
pub enum Code {
kSuccess = 0,
kFailed = 1,
kHasMore = 2,
... // more types
}
And I got this compile error:
#[derive(Debug, Copy, Clone, FromPrimitive)
^^^^^^^^^^^^^
help: message: num-derive doesn't know how to handle newtypes with named fields yet. Please use a tuple-style nentype, or submit a PR!
num-derive
version: 0.3.3
Can anyone give me some advice? Thx in advance!