Skip to content

Commit a2f70cd

Browse files
committed
remove unused match
I also remove this in #16308, so even with additional variants we don't need the `match`. It was needed in an earlier draft of this prototype to emit a different syntax error as a ruff rule diagnostic
1 parent 8c4cf8c commit a2f70cd

File tree

1 file changed

+6
-8
lines changed
  • crates/ruff_linter/src/message

1 file changed

+6
-8
lines changed

crates/ruff_linter/src/message/mod.rs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ pub use pylint::PylintEmitter;
1616
pub use rdjson::RdjsonEmitter;
1717
use ruff_diagnostics::{Diagnostic, DiagnosticKind, Fix};
1818
use ruff_notebook::NotebookIndex;
19-
use ruff_python_parser::{ParseError, SyntaxError, SyntaxErrorKind};
19+
use ruff_python_parser::{ParseError, SyntaxError};
2020
use ruff_source_file::{SourceFile, SourceLocation};
2121
use ruff_text_size::{Ranged, TextLen, TextRange, TextSize};
2222
pub use sarif::SarifEmitter;
@@ -123,13 +123,11 @@ impl Message {
123123

124124
/// Create a [`Message`] from the given [`SyntaxError`].
125125
pub fn from_syntax_error(syntax_error: &SyntaxError, file: SourceFile) -> Message {
126-
match syntax_error.kind {
127-
SyntaxErrorKind::MatchBeforePy310 => Message::SyntaxError(SyntaxErrorMessage {
128-
message: format!("SyntaxError: {syntax_error}"),
129-
range: syntax_error.range,
130-
file,
131-
}),
132-
}
126+
Message::SyntaxError(SyntaxErrorMessage {
127+
message: format!("SyntaxError: {syntax_error}"),
128+
range: syntax_error.range,
129+
file,
130+
})
133131
}
134132

135133
pub const fn as_diagnostic_message(&self) -> Option<&DiagnosticMessage> {

0 commit comments

Comments
 (0)