You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 15, 2021. It is now read-only.
fails, as serialize_unit is implemented by simply calling serialize_none and serialize_some does not prepend a determinant (per CBOR specification). This leads to this incorrect behavior where a type implementing Serialize + Deserialize is not correctly isomorphic to its wire representation. I'm not fully familiar with the CBOR spec but presumably one could choose to serialize an empty tuple or other sequential structure or maybe a single-variant enum to represent the unit type. This is distinct to the failure to round-trip observed in #5 as the fundamental cause here is the use of 0xF6 as a marker value for both None and () leading to None::<()> and Some(()) having the same representation.
The text was updated successfully, but these errors were encountered:
fails, as
serialize_unit
is implemented by simply callingserialize_none
andserialize_some
does not prepend a determinant (per CBOR specification). This leads to this incorrect behavior where a type implementingSerialize + Deserialize
is not correctly isomorphic to its wire representation. I'm not fully familiar with the CBOR spec but presumably one could choose to serialize an empty tuple or other sequential structure or maybe a single-variant enum to represent the unit type. This is distinct to the failure to round-trip observed in #5 as the fundamental cause here is the use of0xF6
as a marker value for bothNone
and()
leading toNone::<()>
andSome(())
having the same representation.The text was updated successfully, but these errors were encountered: