parser : match plus lisible pour parse_backslash
This commit is contained in:
parent
5584f49c87
commit
eaa9622446
1 changed files with 4 additions and 5 deletions
|
@ -17,11 +17,10 @@ fn parse_quote(characters: &mut Vec<char>) -> String {
|
|||
}
|
||||
|
||||
fn parse_backslash(characters: &mut Vec<char>) -> Option<char> {
|
||||
let mut escaped_char: Option<char> = 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
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue