arcnmx / serde-ini

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

de: missing de::from_* methods? #1

Closed lucab closed 6 years ago

lucab commented 6 years ago

I was looking at this crate in order to deserialize some INI files directly into their Rust struct with the usual serde idiom:

let data: MyStruct = serde_ini::from_str(input)?;

However I don't see any of the usual de::from_*() methods. Are they still pending or am I missing something?

I saw you have a public Parser with an iterator interface and several From implementations, but I'm looking for something with direct deserialization and access to sections/values instead.

arcnmx commented 6 years ago

Yeah, they're probably missing and should be added. Those are just convenience methods though, you can still create and use the deserializer like:

let data = MyStruct::deserialize(&mut serde_ini::Deserializer::new(serde_ini::Parser::from_str(input)));
arcnmx commented 6 years ago

Fixed by #2