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

Feature Request: Allow setting duplicated properties

Open RouHim opened this issue 2 years ago • 1 comments

Hello thank you for this great library, I'm currently working on a project where I need to add duplicate properties:

[foo]
bar=1
bar=2

I see that there is a get_all() for property retrieval:

ini.section("foo").unwrap()
   .get_all("bar");

which would return all bar entries.

When I now try to use the setter API to add entries, it would always overwrite the entry, which is clearly documented, thanks for that.

So I have the proposal to introduce a new API that works like set but allows duplicate entries:

ini
    .with_section("foo")
    .add("bar", "1")
    .add("bar", "2");

which would lead to my first listing.

RouHim avatar Apr 03 '24 14:04 RouHim

I would like to provide a PR if that's ok for you.

RouHim avatar Apr 03 '24 14:04 RouHim