Skip to content

Commit d82c53b

Browse files
committed
clippy
1 parent ff0dea9 commit d82c53b

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

crates/ruff_linter/src/linter.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ pub fn check_path(
300300
diagnostics.extend(
301301
parsed
302302
.syntax_errors(settings.target_version.into())
303-
.flat_map(|error| try_diagnostic_from_syntax_error(error, &settings.rules)),
303+
.filter_map(|error| try_diagnostic_from_syntax_error(error, &settings.rules)),
304304
);
305305

306306
// Remove fixes for any rules marked as unfixable.

crates/ruff_linter/src/message/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ pub use pylint::PylintEmitter;
1717
pub use rdjson::RdjsonEmitter;
1818
use ruff_diagnostics::{Diagnostic, DiagnosticKind, Fix};
1919
use ruff_notebook::NotebookIndex;
20-
use ruff_python_parser::{ParseError, SyntaxError};
20+
use ruff_python_parser::{ParseError, SyntaxError, SyntaxErrorKind};
2121
use ruff_source_file::{SourceFile, SourceLocation};
2222
use ruff_text_size::{Ranged, TextLen, TextRange, TextSize};
2323
pub use sarif::SarifEmitter;
@@ -130,15 +130,15 @@ impl Message {
130130
noqa_offset: TextSize,
131131
) -> Message {
132132
match syntax_error.kind {
133-
ruff_python_parser::SyntaxErrorKind::LateFutureImport => Message::from_diagnostic(
133+
SyntaxErrorKind::LateFutureImport => Message::from_diagnostic(
134134
Diagnostic::new(
135135
crate::rules::pyflakes::rules::LateFutureImport,
136136
syntax_error.range,
137137
),
138138
file,
139139
noqa_offset,
140140
),
141-
_ => Message::SyntaxError(SyntaxErrorMessage {
141+
SyntaxErrorKind::MatchBeforePy310 => Message::SyntaxError(SyntaxErrorMessage {
142142
message: format!("SyntaxError: {}", syntax_error.message(target_version)),
143143
range: syntax_error.range,
144144
file,

crates/ruff_python_parser/src/error.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -451,8 +451,8 @@ impl SyntaxError {
451451
match self.kind {
452452
SyntaxErrorKind::MatchBeforePy310 => PythonVersion::PY310,
453453
SyntaxErrorKind::LateFutureImport => PythonVersion {
454-
major: std::u8::MAX,
455-
minor: std::u8::MAX,
454+
major: u8::MAX,
455+
minor: u8::MAX,
456456
},
457457
}
458458
}

0 commit comments

Comments
 (0)