test(harness): collapse live_marker_count match into matches!

Clippy (match_same_arms) on the Step C rewrite: Ok(false) and Err(_)
both mean "treat as alive", so expressing it as `if matches!(..., Ok(true))`
reads cleaner and satisfies the lint.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Bryan Helmkamp 2026-04-20 16:38:28 -04:00
parent 39744068c9
commit 224ce9e21e
No known key found for this signature in database

View file

@ -514,17 +514,17 @@ fn live_marker_count(root: &Path) -> usize {
else {
return false;
};
match fabro_proc::try_flock_exclusive(&file) {
Ok(true) => {
// Lock acquired: previous owner is gone. Drop the
// file handle (releasing our just-acquired lock)
// and remove the marker.
drop(file);
let _ = std::fs::remove_file(path);
false
}
Ok(false) => true,
Err(_) => true, // conservative: count unexpected errors as alive
// If the lock is acquired, the previous owner is gone; drop
// the file handle (releasing our just-acquired lock) and
// remove the marker. Anything else (`Ok(false)` meaning
// still held, `Err(_)` for unexpected IO errors) is treated
// conservatively as live.
if matches!(fabro_proc::try_flock_exclusive(&file), Ok(true)) {
drop(file);
let _ = std::fs::remove_file(path);
false
} else {
true
}
})
.count()