The array `variants` passed from serde does not contain enum variant
aliases. Thus for an unit_variant that has an alias, the alias name
was interpreted as an object id and the deserialization failed.
On the other hand, for a non-in-value enum value, the full string was
passed to `Enum::new` and somehow serde can determine the variant
from `variant_seed`, even if the string is a variant alias.
Therefore, to make the in-value case work, the value string is always
interpreted as an object id first. If an object string cannot be
found, the object id is interpreted as the object string. In both two
cases, the object string is passed to `Enum::new` to let serde find
out which variant it is.
Signed-off-by: Changyuan Lyu <changyuanl@google.com>
`serde-aco` is for parsing complex data structures from command line.
Nested structures can be expressed by multiple key-value pair
strings.
This crate is inspired by QEMU's `-object` flag.
Signed-off-by: Changyuan Lyu <changyuanl@google.com>