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
structX(i32,i32);let x = X(0,0);// Represented as `[0,0]`structY(i32);let y = Y(0);// Represented as just the inner value `0`structZ;let z = Z;// Represented as `null`
This could've easily been [0,0], [0] and []. RON for example, does distinguish None from ().
ciborium could change this but it'd be a breaking change, so not sure if people want to do that. Or it could there could be an option.
serde_derive supports #[serde(transparent)] for [0] to 0. It could have something similar for having [] turn into null, i.e. serialize_none().
Is there an existing issue for this?
Code of Conduct
Current Behaviour
Given the type:
Some(Test)
, roundtripped through encode/decode comes back asNone
.It appears that it's actually being encoded as
None
(F6 / null in CBOR).Expected Behaviour
The value
Some(Test)
should roundtrip asSome(Test)
and be encoded in a fashion which can be recovered.Environment Information
Steps To Reproduce
There's a minimal reproduction of this issue here:
https://www.rustexplorer.com/b/3cig4b
The text was updated successfully, but these errors were encountered: