diff --git a/parser/src/errors/syntax.rs b/parser/src/errors/syntax.rs index 335dc8aa29..306719b5a4 100644 --- a/parser/src/errors/syntax.rs +++ b/parser/src/errors/syntax.rs @@ -101,7 +101,7 @@ impl SyntaxError { } pub fn unexpected_statement(got: String, expected: &str, span: &Span) -> Self { - Self::new_from_span(format!("expected '{}', got '{}'", expected, got.to_string()), span) + Self::new_from_span(format!("expected '{}', got '{}'", expected, got), span) } pub fn unexpected_str(got: &Token, expected: &str, span: &Span) -> Self {