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)]
enum A {
#[serde(untagged)]
A {
a: u8
}
}
#[derive(Serialize, Deserialize)]
#[serde(untagged)]
enum B {
C(C)
}
#[derive(Serialize, Deserialize)]
enum C {
C
}
fn main() {
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();
}
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
.