diff --git a/parser/src/error.rs b/parser/src/error.rs index 7a4f60b..eda73b5 100644 --- a/parser/src/error.rs +++ b/parser/src/error.rs @@ -42,7 +42,7 @@ impl fmt::Display for LexicalErrorType { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { match self { LexicalErrorType::StringError => write!(f, "Got unexpected string"), - LexicalErrorType::FStringError(error) => write!(f, "Got error in f-string: {error}"), + LexicalErrorType::FStringError(error) => write!(f, "f-string: {error}"), LexicalErrorType::UnicodeError => write!(f, "Got unexpected unicode"), LexicalErrorType::NestingError => write!(f, "Got unexpected nesting"), LexicalErrorType::IndentationError => { diff --git a/parser/src/string_parser.rs b/parser/src/string_parser.rs index b305493..df751e2 100644 --- a/parser/src/string_parser.rs +++ b/parser/src/string_parser.rs @@ -358,11 +358,7 @@ impl<'a> StringParser<'a> { } } } - Err(if expression.trim().is_empty() { - FStringError::new(EmptyExpression, self.get_pos()).into() - } else { - FStringError::new(UnclosedLbrace, self.get_pos()).into() - }) + Err(FStringError::new(UnclosedLbrace, self.get_pos()).into()) } fn parse_spec(&mut self, nested: u8) -> Result, LexicalError> {