Skip to content

Commit a2c834c

Browse files
Make syntax-error-recovery filter more robust
Co-authored-by: Samuel Tardieu <[email protected]>
1 parent 3e26a6f commit a2c834c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

clippy_dev/src/fmt.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -290,11 +290,12 @@ fn run_rustfmt(context: &FmtContext) -> Result<(), Error> {
290290
.filter_map(|entry| {
291291
let entry = entry.expect("failed to find tests");
292292
let path = entry.path();
293-
294293
if path.extension() != Some("rs".as_ref())
295294
|| path
296295
.components()
297-
.any(|component| component.as_os_str() == "syntax-error-recovery")
296+
.rev()
297+
.nth(1)
298+
.is_some_and(|c| c.as_os_str() == "syntax-error-recovery")
298299
|| entry.file_name() == "ice-3891.rs"
299300
{
300301
None

0 commit comments

Comments
 (0)