mirror of https://github.com/astral-sh/ruff
Remove unused f-string error type (#6941)
This commit is contained in:
parent
60097bebcd
commit
2893a9f6b5
|
|
@ -717,10 +717,6 @@ impl From<FStringError> for LexicalError {
|
||||||
pub enum FStringErrorType {
|
pub enum FStringErrorType {
|
||||||
/// Expected a right brace after an opened left brace.
|
/// Expected a right brace after an opened left brace.
|
||||||
UnclosedLbrace,
|
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.
|
/// An error occurred while parsing an f-string expression.
|
||||||
InvalidExpression(Box<ParseErrorType>),
|
InvalidExpression(Box<ParseErrorType>),
|
||||||
/// An invalid conversion flag was encountered.
|
/// An invalid conversion flag was encountered.
|
||||||
|
|
@ -745,14 +741,12 @@ pub enum FStringErrorType {
|
||||||
impl std::fmt::Display for FStringErrorType {
|
impl std::fmt::Display for FStringErrorType {
|
||||||
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
|
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
|
||||||
use FStringErrorType::{
|
use FStringErrorType::{
|
||||||
EmptyExpression, ExpectedRbrace, ExpressionCannotInclude, ExpressionNestedTooDeeply,
|
EmptyExpression, ExpressionCannotInclude, ExpressionNestedTooDeeply,
|
||||||
InvalidConversionFlag, InvalidExpression, MismatchedDelimiter, SingleRbrace,
|
InvalidConversionFlag, InvalidExpression, MismatchedDelimiter, SingleRbrace,
|
||||||
UnclosedLbrace, Unmatched, UnopenedRbrace, UnterminatedString,
|
UnclosedLbrace, Unmatched, UnterminatedString,
|
||||||
};
|
};
|
||||||
match self {
|
match self {
|
||||||
UnclosedLbrace => write!(f, "expecting '}}'"),
|
UnclosedLbrace => write!(f, "expecting '}}'"),
|
||||||
UnopenedRbrace => write!(f, "Unopened '}}'"),
|
|
||||||
ExpectedRbrace => write!(f, "Expected '}}' after conversion flag."),
|
|
||||||
InvalidExpression(error) => {
|
InvalidExpression(error) => {
|
||||||
write!(f, "{error}")
|
write!(f, "{error}")
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue