Update compiler/parser/src/fstring.rs

Co-authored-by: Zgarbul Andrey <zgarbul.andrey@gmail.com>
This commit is contained in:
Harutaka Kawamura 2022-12-29 08:10:33 +09:00 committed by GitHub
parent 7e8f683808
commit b707f53f23

View file

@ -207,14 +207,12 @@ impl<'a> FStringParser<'a> {
'"' | '\'' => {
expression.push(ch);
loop {
match self.next_char() {
Some(c) => {
expression.push(c);
if c == ch {
break;
}
}
None => return Err(UnterminatedString),
let Some(c) = self.next_char() else {
return Err(UnterminatedString);
};
expression.push(c);
if c == ch {
break;
}
}
}