corn-config / corn

🌽 A simple and pain-free configuration language. Reference libcorn implementation and CLI.
https://cornlang.dev
MIT License
40 stars 5 forks source link

Ability to deserialize into a struct #4

Closed JakeStanger closed 1 year ago

JakeStanger commented 2 years ago

Currently cornfig::parse returns the a tree of parsed values which isn't super useful for library use. A serde::Deserializer implementation should be written to attempt to deserialize into structs.

It's possible to serialize the Corn output using serde then deserialize it again, but this comes with a lot of overhead and requires shipping another format library.

JakeStanger commented 2 years ago

Similar project that does this that might be worth looking at: https://github.com/ron-rs/ron