mehcode / config-rs

⚙️ Layered configuration system for Rust applications (with strong support for 12-factor applications).
Apache License 2.0
2.43k stars 206 forks source link

refactor: `ini` format parser #470

Open polarathene opened 8 months ago

polarathene commented 8 months ago

Intended to be easier to grok and match the same flow as other format parsers.


I worked on this after https://github.com/mehcode/config-rs/pull/469 , but my main gripes were with the sec not being obvious that it was referencing a section, and the repeated inner loop for building property maps.

I added the same enum check with the final Table map wrapped in Value like other parsers, although for this that may be redundant and could be dropped?

Not too fussed if you want to reject this. I originally envisioned it looking nicer than it turned out 😅