rust-ini
rust-ini copied to clipboard
Add conversion from Section to INI
I have a project that that a large INI where subsets of this configuration gets passed to smaller tasks downstream. My idea was to use this library to parse the large INI file, then downstream tasks can use serde-ini to parse the INI subset according to their specifications.
To achieve this, I added a function to sections where they can convert themselves to an INI file with only themselves as an entry. This newly generated subset of the INI file can then be passed to downstream services. Notably, this is simpler than re-implementing the write_to functions for Sections
In the end, I think with this more complicated setup it maybe better to just use TOML, but I'm sharing the code anyway since somebody else may find this useful.