Commit graph

5 commits

Author SHA1 Message Date
Changyuan Lyu
971aadb7ed fix(aco): report an error in deserialize_any()
Signed-off-by: Changyuan Lyu <changyuanl@google.com>
2024-07-20 17:53:03 -07:00
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
Changyuan Lyu
ab5a08d387 chore: bump version to 0.3.0
Signed-off-by: Changyuan Lyu <changyuanl@google.com>
2024-07-04 16:34:35 -07:00
Changyuan Lyu
3c241aa63e chore: bump version to 0.2.0
Signed-off-by: Changyuan Lyu <changyuanl@google.com>
2024-05-24 13:56:06 -07:00
Changyuan Lyu
6e97023603 feat(cli): add a new crate for parsing cli opts
`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>
2024-05-22 00:00:14 -07:00