Closed rikyborg closed 3 months ago
Fixes #134
Allow both for chaining calls to set/add/delete, and for separate calls of those methods on the same SectionSetter variable:
set
add
delete
SectionSetter
let mut ini = Ini::new(); let mut section_setter = ini.with_section(Some("section")); // chained set() calls section_setter.set("a", "1").set("b", "2"); // separate set() calls section_setter.set("c", "3");
The last call would previously raise a compiler error because section_setter was still mutably borrowed until it went out of scope.
section_setter
Also, change get() method to take &self rather than &mut self.
get()
&self
&mut self
Fixes #134
Allow both for chaining calls to
set
/add
/delete
, and for separate calls of those methods on the sameSectionSetter
variable:The last call would previously raise a compiler error because
section_setter
was still mutably borrowed until it went out of scope.Also, change
get()
method to take&self
rather than&mut self
.