alioth/serde-aco
Changyuan Lyu 7f56e61198 fix(aco): make in-value enum variant aliases work
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>
2024-07-13 20:51:40 -07:00
..
src fix(aco): make in-value enum variant aliases work 2024-07-13 20:51:40 -07:00
Cargo.toml