-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Insert Duplicate Section? #65
Comments
Hmm, I didn't add that because Consider using the let mut ini = Ini::new();
match ini.entry(Some("KeyDuplicated")) {
SectionEntry::Vacant(mut vac) => {
}
SectionEntry::Occupied(mut occ) => {
// Append a new section with the same name
occ.append(...);
}
} |
@zonyitoo thanks for the tip, I'll let you know if it covers my use case and close this out. Yes, with your API and how things work it did feel odd adding in what I described. I really wish |
@zonyitoo @theonewolf I am also working with systemd files and run into this issue. Is the above workaround still the recommended way to achieve this? |
Maybe, I haven't thought about it since the last discussion. |
What came to mind was to look for a function like I'm not sure if this makes sense from your API design, but it would be similar to how I can add duplicate keys using |
I am testing support for duplicate sections, and I can not figure out how to add a new section with the same name as an old section. I actually don't think it's exposed in your API currently.
Parsing duplicate sections from files works fine, but adding same named sections does not (using
with_section
). I recommend adding a new method for instantiating sections, or a boolean onwith_section
that flags creation of a section--not retrieval / insertion into a pre-existing section.@zonyitoo very close to having full support for #49! Instead of re-opening it, I figured I'd file another bug report.
The text was updated successfully, but these errors were encountered: