diff --git a/src/lib.rs b/src/lib.rs index a755a30..0446832 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -639,7 +639,7 @@ pub(crate) fn eat_expr>( fn eat_interpolation>(toks: &mut Peekable) -> Vec { let mut vals = Vec::new(); let mut n = 0; - while let Some(tok) = toks.next() { + for tok in toks { match tok.kind { TokenKind::Symbol(Symbol::OpenCurlyBrace) => n += 1, TokenKind::Symbol(Symbol::CloseCurlyBrace) => n -= 1, diff --git a/src/value.rs b/src/value.rs index f96d131..00fed93 100644 --- a/src/value.rs +++ b/src/value.rs @@ -271,9 +271,8 @@ impl Value { TokenKind::Symbol(Symbol::DoubleQuote) => { let mut s = String::new(); while let Some(tok) = toks.next() { - match tok.kind { - TokenKind::Symbol(Symbol::DoubleQuote) => break, - _ => {} + if tok.kind == TokenKind::Symbol(Symbol::DoubleQuote) { + break; } s.push_str(&tok.kind.to_string()); } @@ -282,9 +281,8 @@ impl Value { TokenKind::Symbol(Symbol::SingleQuote) => { let mut s = String::new(); while let Some(tok) = toks.next() { - match tok.kind { - TokenKind::Symbol(Symbol::SingleQuote) => break, - _ => {} + if tok.kind == TokenKind::Symbol(Symbol::SingleQuote) { + break; } s.push_str(&tok.kind.to_string()); }