rust-ini
rust-ini copied to clipboard
Ini::iter always return general section even it's empty since 0.19
I'm not sure if this change is intended or introduced by accident (by #88 I guess).
0.18 and before: Ini::new().next()
is None
0.19 and after: Ini::new().next()
is Some((None, Properties { data: {} }))
(P.S I was iterating all sections from user-generated ini file and prohibited empty section. This change break the logic since now there is always a empty general section.)
Well, yes. It was added from #88 .
Maybe we can add a Ini::new_empty()
method to create a truely empty Ini
?
It also affects, for example, Ini::load_from_file
: a file consisting solely of named sections appears to have an empty general group in its iterator.
We might add a check in the iterator impl to not yield an empty general group?
We might add a check in the iterator impl to not yield an empty general group?
It looks like a good solution that wouldn't break compatibility (maybe).