arcnmx / serde-ini

Windows INI file {de,}serialization
MIT License
19 stars 17 forks source link

Deserialize to sequence of enum types #15

Closed jerry73204 closed 2 years ago

jerry73204 commented 3 years ago

The patch deals with repeated top level sections. For example,

[person]
name = "Ana"

[person]
name = "Box"

It enables the deserialization into a sequence of enum types. The code below will work out of box.

#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
enum Person {
    pub name: String
}

let people: Vec<Person> = serde_ini::from_str(ini_text)?;
jerry73204 commented 3 years ago

The patch has an extra commit that runs rustfmt on the whole repo.

arcnmx commented 2 years ago

Sorry this took so long to get to - merged as 53fe15c4de8b415661b9697f48870fea079b436b without the formatting changes. I still need to mull over how to use rustfmt...