mirror of
https://github.com/astral-sh/ruff.git
synced 2025-07-24 13:33:50 +00:00
Remove unused f-string error type (#6941)
This commit is contained in:
parent
60097bebcd
commit
2893a9f6b5
1 changed files with 2 additions and 8 deletions
|
@ -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}")
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue