diff --git a/src/parser.rs b/src/parser.rs index 97a69f6..8ede708 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -17,11 +17,10 @@ fn parse_quote(characters: &mut Vec) -> String { } fn parse_backslash(characters: &mut Vec) -> Option { - let mut escaped_char: Option = None; - - if !characters.is_empty() { - escaped_char = Some(characters.pop().unwrap()); - } + let escaped_char = match characters.is_empty() { + false => Some(characters.pop().unwrap()), + true => None, + }; escaped_char }