Open 4oooo4 opened 2 months ago
Apologies for the long, overdue acknowledgement. Yes, this is a bug. deserialize_enum
currently only handles scalar values. To properly support all enum
variant types. This requires implementing EnumAccess
. It's achievable, but it's non-trivial. This scenario should be supported if people want to use enumerations this way.
example.json
main.rs
Result:
my_struct_from_serde
deserialized correctly,my_struct_from_config
panicked.The issue is in this enum value:
when i remove it then everything works as expected.