jdarais commented on issue #365:
URL: https://github.com/apache/avro-rs/issues/365#issuecomment-3695033828

   @antonsmetanin @Kriskras99 regarding mixing of unit variants with struct 
variants in rust enum types, it should work if you treat the rust unit type as 
avro null.  I think this is also the mapping used for `serialize_unit` in the 
`Serializer` implementation in both `ser.rs` and `ser_schema.rs`.
   
   With this, having a rust enum type with two unit variants and a struct 
variant (e.g. `enum MyEnum { A, B, C {} }` would be invalid since both A and B 
would be mapped to null, and avro union can't have duplicate types, but having 
a single unit variant combined with struct variants would be valid.  This also 
works with rust's `Option` type without modification, which would map `None` to 
null.


-- 
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