Closed dmatos2012 closed 1 year ago
Hi, This was raised originally in Nushell https://github.com/nushell/nushell/issues/9556,
[placeholder] aws_access_key_id=AAAAAAAAAAAAAAAAAAAAA aws_secret_access_key=BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB aws_session_token=BBBBBBBBBBBBBBBBBBBBBBBB region=us-east-1 output=json [default] aws_access_key_id=AAAAAAAAAAAAAAAAAA aws_secret_access_key=AAAAAAAAAAAAAAAAAAAAAAA aws_session_token=BBBBBBBBBBBBBBBBBBBBBBBB region=us-east-1 output=json
Get sections
let i = Ini::load_from_file("conf.ini").unwrap(); for (sec, prop) in i.iter() { println!("Section: {:?}", sec);
Outputs:
Section: None Section: Some("placeholder") Section: Some("default")
Expected behavior:
Sections placeholder and default but not None section.
placeholder
default
None
Thanks!
https://github.com/zonyitoo/rust-ini/blob/371dc9ad2b44afa04d16de38db984f04433659fb/src/lib.rs#L714-L726
It was intended, checkout the comment.
Ah, It is to allow section-less key-value pairs! Thanks for the fast response!
Hi, This was raised originally in Nushell https://github.com/nushell/nushell/issues/9556,
Get sections
Outputs:
Expected behavior:
Sections
placeholder
anddefault
but notNone
section.Thanks!