mirror of
https://github.com/astral-sh/ruff
synced 2026-01-09 15:44:22 -05:00
Remove unused f-string error type (#6941)
This commit is contained in:
@@ -717,10 +717,6 @@ impl From<FStringError> 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<ParseErrorType>),
|
||||
/// 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}")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user