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
#148 and #149 address when an entire enum is #[serde(untagged)], but if just a single variant is untagged an error occurs.
The following code works fine for deserializing B but panics when deserializing A.
use serde::{Serialize,Deserialize};#[derive(Serialize,Deserialize)]enumA{#[serde(untagged)]A{a:u8}}#[derive(Serialize,Deserialize)]#[serde(untagged)]enumB{C(C)}#[derive(Serialize,Deserialize)]enumC{C}fnmain(){let data = rmp_serde::to_vec(&B::C(C::C)).unwrap();
rmp_serde::from_slice::<B>(&data).unwrap();let data = rmp_serde::to_vec(&A::A{a:2}).unwrap();
rmp_serde::from_slice::<A>(&data).unwrap();}
The text was updated successfully, but these errors were encountered:
#148 and #149 address when an entire enum is
#[serde(untagged)]
, but if just a single variant is untagged an error occurs.The following code works fine for deserializing
B
but panics when deserializingA
.The text was updated successfully, but these errors were encountered: