You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 on with_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:
Hmm, I didn't add that because with_section was defined for insert or modify the section that is already existed.
Consider using the entry API:
letmut 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 systemd used a standard configuration format vs rolling their own.
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: