rust-ini icon indicating copy to clipboard operation
rust-ini copied to clipboard

Add conversion from Section to INI

Open SebastienGllmt opened this issue 3 years ago • 0 comments

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.

SebastienGllmt avatar May 19 '22 02:05 SebastienGllmt