Open qzed opened 6 years ago
This was addressed by #26 but I'm concerned it may be a bit of a lossy conversion, so I'll leave this open for now pending feedback.
Thanks for the update! Haven't tested it yet, but as far as I can tell, this should work. It's pretty much the same as serializing to something like json, so I don't think there should be any issues with regards to lossy conversion.
If I understand
serde
correctly, theserialize_<...>_variant
functions should emit an externally tagged enum, i.e. some sort of map"variant" => <content>
(or simply"variant"
in case of a unit-variant). Currently the serializer does not store any information on the enum variant (e.g. inserialize_unit_variant
), which effectively transforms this into an untagged enum. Thus multiple variants (e.g. of unit-type) are not distinguishable.