msgpack-rust
msgpack-rust copied to clipboard
Option serializing is fundamentally broken
It doesn't serialize the enumerator.
fn serialize_some<T: ?Sized + serde::Serialize>(self, v: &T) -> Result<(), Self::Error> {
v.serialize(self)
}
It would probably make sense to change this to encode None as a 0-sized array and Some as a 1-sized array.
Yes, it tries to be clever by using null for None, but that can't express nesting.