Open josecelano opened 1 year ago
Using "tag" and "content" at the same time on the enum have the same issue:
#[derive(Deserialize, Serialize)]
struct A {
#[serde(flatten)]
b: B,
}
#[derive(Deserialize, Serialize)]
#[serde(tag = "a", content = "b")]
enum B {
C,
}
let a = A { b: B::C };
let s = serde_bencode::to_string(&a).unwrap();
let _: A = serde_bencode::from_bytes(s.as_bytes()).unwrap();
I think these two failing tests could be the same problem because they both use
#[serde(flatten)]
for anenum
field.cargo test ser_de_flattened_enum -- --nocapture
cargo test ser_de_flattened_adjacently_tagged_enum -- --nocapture
Failing test 1
Failing test 2
Related commits