Skip to content

Add conversion from Section to INI#90

Open
SebastienGllmt wants to merge 1 commit into
zonyitoo:masterfrom
dcSpark:ini-subset
Open

Add conversion from Section to INI#90
SebastienGllmt wants to merge 1 commit into
zonyitoo:masterfrom
dcSpark:ini-subset

Conversation

@SebastienGllmt

Copy link
Copy Markdown
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant