diff --git a/src/lib.rs b/src/lib.rs index 3a5772e..73d4ccf 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -640,7 +640,7 @@ impl Ini { let key = section_key!(section); self.sections.remove(&key) } - + /// Delete the key from the section, return the value if key exists or None pub fn delete_from(&mut self, section: Option, key: &str) -> Option where S: Into @@ -1133,7 +1133,12 @@ impl<'a> Parser<'a> { } let r = u32::from_str_radix(&code[..], 16); match r { - Ok(c) => result.push(char::from_u32(c).unwrap()), + Ok(c) => match char::from_u32(c) { + Some(c) => result.push(c), + None => { + return self.error("unknown character in \\xHH form"); + } + }, Err(_) => return self.error("unknown character in \\xHH form"), } }