Skip to content

v1.0.162

Compare
Choose a tag to compare
@dtolnay dtolnay released this 05 May 01:51
· 387 commits to master since this release
v1.0.162
99f165b
  • Support deserializing flattened adjacently tagged enums from data formats which represent fields as bytes, such as the csv crate (#2377, thanks @mfro)

    #[derive(Deserialize)]
    pub struct Record {
        common: u64,
        #[serde(flatten)]
        kind: Kind,
    }
    
    #[derive(Deserialize)]
    #[serde(tag = "kind", content = "parameter", rename_all = "lowercase")]
    enum Kind {
        Foo(u64),
        Bar(bool),
    }
    common,kind,parameter
    1,foo,42
    2,bar,true