[][src]Function mininip::parse::parse_str

pub fn parse_str(content: &str) -> Result<String, Error>

Reads a string formatted by dump_str and unescapes the escaped characters

Return value

Ok(string) with string as the result once parsed

Err(err) In case of error with err as the error code

Encoding issues

Only allows ASCII because Unicode or other encodings musn't appear in an INI file (except in comments but this function is not intended to parse whole files)

Examples

use mininip::parse::parse_str;
 
assert!(parse_str("Bad because ends with a ;").is_err());
assert_eq!(parse_str(r"abc\=123\; \x00263a").unwrap(), "abc=123; \u{263a}");