Skip to main content

set_ini_key

Function set_ini_key 

Source
pub fn set_ini_key(text: &str, section: &str, key: &str, value: &str) -> String
Expand description

Sets one key in one section and leaves every other byte as it was, since the file is the package author’s and parsing it into a map would rewrite it.

Comment lines never match, the spacing around = and any inline comment are kept, line endings stay the file’s, and a missing key joins its own section rather than the end of the file.