From bcfd809c92756084a364a47f71b4b2a92b51fa92 Mon Sep 17 00:00:00 2001 From: ConnorSkees <39542938+ConnorSkees@users.noreply.github.com> Date: Mon, 6 Jan 2020 18:45:41 -0500 Subject: [PATCH] Fix bug where the entire iterator would be eaten by a comment --- src/lexer.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lexer.rs b/src/lexer.rs index 209ff19..735151c 100644 --- a/src/lexer.rs +++ b/src/lexer.rs @@ -150,7 +150,7 @@ impl<'a> Lexer<'a> { self.pos.next_char(); match self.buf.peek().expect("expected something after '/'") { '/' => { - self.buf.by_ref().skip_while(|x| x != &'\n').count(); + self.buf.by_ref().take_while(|x| x != &'\n').for_each(drop); } '*' => { while let Some(tok) = self.buf.next() {