From 224ce9e21e185fa09b9d92c506af66dc56293d8b Mon Sep 17 00:00:00 2001 From: Bryan Helmkamp Date: Mon, 20 Apr 2026 16:38:28 -0400 Subject: [PATCH] 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) --- lib/crates/fabro-test/src/lib.rs | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/lib/crates/fabro-test/src/lib.rs b/lib/crates/fabro-test/src/lib.rs index 2ece1bb83..b428cc482 100644 --- a/lib/crates/fabro-test/src/lib.rs +++ b/lib/crates/fabro-test/src/lib.rs @@ -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()