antonsmetanin opened a new pull request, #366:
URL: https://github.com/apache/avro-rs/pull/366

   ## Description
   Fix for the issue described here: 
https://github.com/apache/avro-rs/issues/365
   
   ## Changes
   - changed `SeqVariantSerializer` and `StructVariantSerializer` to serialize 
Enum variants as `Union(...)` directly
    instead of `Record([("type", Enum(...)) ("value, Union(...))])`;
   - since they don't need to store the `variant` anymore, I removed the field 
and removed the lifetime annotation
    that was only needed because this field was a `&str`;
   - `SeqVariantSerializer` had two implementations: 
`ser::SerializeTupleVariant` and `ser::SerializeStructVariant`,
    where the first one delegated everything to the second one, but the second 
one was never used by itself,
    so I removed it;
   - changed the logic of the `resolve_union` function so that it uses the 
index from `Value::Union`
    to get the correct schema;
   - added a new Error variant `UnionIndexOutOfBounds` for cases where this 
index gets out of bounds;
   - wrote a test that fails before the fix and succeeds after.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to