Skip to content

Commit

Permalink
Better unreachable messages
Browse files Browse the repository at this point in the history
  • Loading branch information
jpikl committed Jul 9, 2023
1 parent a9ece4a commit fe64adf
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/commands/x/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ impl Parser<'_> {
match self.peek() {
Some(quote @ ('\'' | '"')) => self.parse_quote_arg(quote),
Some(_) => self.parse_unquote_arg(),
None => unreachable!("unexpected EOF"),
None => unreachable!("unexpected EOF when parsing arg"),
}
}

Expand Down Expand Up @@ -248,8 +248,8 @@ impl Parser<'_> {
fn consume(&mut self, expected: char) -> char {
match self.next() {
Some(char) if char == expected => char,
Some(char) => unreachable!("expected '{}' but got '{}'", expected, char),
None => unreachable!("expected '{}' but got EOF", expected),
Some(char) => unreachable!("parser expected '{}' but got '{}'", expected, char),
None => unreachable!("parser expected '{}' but got EOF", expected),
}
}

Expand Down

0 comments on commit fe64adf

Please sign in to comment.