From 2893a9f6b52df3a23bde0b9a5433cc6cf9d8e928 Mon Sep 17 00:00:00 2001 From: Dhruv Manilawala Date: Mon, 28 Aug 2023 18:34:48 +0530 Subject: [PATCH] Remove unused f-string error type (#6941) --- crates/ruff_python_parser/src/string.rs | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/crates/ruff_python_parser/src/string.rs b/crates/ruff_python_parser/src/string.rs index c182ea52ee..936c4fdef1 100644 --- a/crates/ruff_python_parser/src/string.rs +++ b/crates/ruff_python_parser/src/string.rs @@ -717,10 +717,6 @@ impl From for LexicalError { pub enum FStringErrorType { /// Expected a right brace after an opened left brace. UnclosedLbrace, - /// Expected a left brace after an ending right brace. - UnopenedRbrace, - /// Expected a right brace after a conversion flag. - ExpectedRbrace, /// An error occurred while parsing an f-string expression. InvalidExpression(Box), /// An invalid conversion flag was encountered. @@ -745,14 +741,12 @@ pub enum FStringErrorType { impl std::fmt::Display for FStringErrorType { fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { use FStringErrorType::{ - EmptyExpression, ExpectedRbrace, ExpressionCannotInclude, ExpressionNestedTooDeeply, + EmptyExpression, ExpressionCannotInclude, ExpressionNestedTooDeeply, InvalidConversionFlag, InvalidExpression, MismatchedDelimiter, SingleRbrace, - UnclosedLbrace, Unmatched, UnopenedRbrace, UnterminatedString, + UnclosedLbrace, Unmatched, UnterminatedString, }; match self { UnclosedLbrace => write!(f, "expecting '}}'"), - UnopenedRbrace => write!(f, "Unopened '}}'"), - ExpectedRbrace => write!(f, "Expected '}}' after conversion flag."), InvalidExpression(error) => { write!(f, "{error}") }