mirror of
https://github.com/google/alioth.git
synced 2024-10-23 15:00:13 +00:00
7f56e61198
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> |
||
---|---|---|
.. | ||
src | ||
Cargo.toml |