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
'called `Result::unwrap()` on an `Err` value: Custom("invalid type: integer `42`, expected unit")'
#[test]fnserde_other_value(){#[derive(Deserialize)]enumE{A(u32),#[serde(other)]Unknown,}#[derive(Serialize)]enumF{A(u32),B(u64),#[serde(other)]Unknown,}letmut buf = vec![];let b = F::B(42);
ciborium::ser::into_writer(&b,Cursor::new(&mut buf)).unwrap();let unk_from_reader:E = ciborium::de::from_reader(Cursor::new(&buf)).unwrap();// It works when deserializing directly from the readerassert!(matches!(unk_from_reader, E::Unknown));let v: ciborium::Value = ciborium::de::from_reader(Cursor::new(&buf)).unwrap();let unk_from_value:E = v.deserialized().unwrap();// This is the failing assertionassert!(matches!(unk_from_value, E::Unknown));}
Expected Behaviour
I expect the Unknown variant to be deserialized regardless of whether there's an intermediate Value step.
Environment Information
N/A
Steps To Reproduce
No response
The text was updated successfully, but these errors were encountered:
Is there an existing issue for this?
Code of Conduct
Current Behaviour
The following test fails with
Expected Behaviour
I expect the
Unknown
variant to be deserialized regardless of whether there's an intermediateValue
step.Environment Information
N/A
Steps To Reproduce
No response
The text was updated successfully, but these errors were encountered: