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
The following code fails to deserialize Some(None):
use serde::{Deserialize,Serialize};#[derive(Debug,Serialize,Deserialize,PartialEq)]structFoo(Option<Option<bool>>);fnmain(){for o in[None,Some(None),Some(Some(true)),Some(Some(false))]{let o = Foo(o);letmut ser = vec![];
ciborium::into_writer(&o,&mut ser).unwrap();let o2:Foo = ciborium::from_reader(&mut ser.as_slice()).unwrap();if o != o2 {println!("error: {o:?} deserialized as {o2:?}");}}}
Running the above code prints:
error: Foo(Some(None)) deserialized as Foo(None)
Expected Behaviour
I expected Some(None) to round-trip through ciborium as Some(None) (i.e. the above program to output nothing). We are investigating ciborium for types that use deserialize_any(), and inability to deserialize nested options is an issue.
I control the code that does the (de-)serialization, so if it's a matter of setting up some configuration, that'd work for me.
Environment Information
$ uname -a
Linux snijeg 5.15.0-107-generic #117-Ubuntu SMP Fri Apr 26 12:26:49 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
$ enarx --version
zsh: command not found: enarx
Steps To Reproduce
Run the included code, and observe the result.
The text was updated successfully, but these errors were encountered:
Is there an existing issue for this?
Code of Conduct
Current Behaviour
The following code fails to deserialize
Some(None)
:Running the above code prints:
Expected Behaviour
I expected
Some(None)
to round-trip throughciborium
asSome(None)
(i.e. the above program to output nothing). We are investigating ciborium for types that usedeserialize_any()
, and inability to deserialize nested options is an issue.I control the code that does the (de-)serialization, so if it's a matter of setting up some configuration, that'd work for me.
Environment Information
Steps To Reproduce
Run the included code, and observe the result.
The text was updated successfully, but these errors were encountered: