From 8512d60ce8ba16fba0cb5b2ddda3abf9a0833848 Mon Sep 17 00:00:00 2001 From: tupe12334 Date: Sun, 21 Jun 2026 19:03:08 +0300 Subject: [PATCH] style(lint): enable clippy::single_match_else Promote clippy::single_match_else to deny (incremental ratchet). The one violation was in run_clean: a match on find_repo_root_from with a trivial Some arm and an early-returning None arm. Rewrite as an idiomatic let-else, which reads as the guard it is. cargo clippy --all-targets and cargo test both pass. Closes #158 Co-Authored-By: Claude Opus 4.8 (1M context) --- core/Cargo.toml | 1 + core/src/bin/main.rs | 10 ++++------ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/core/Cargo.toml b/core/Cargo.toml index 6d801c0..0f7b842 100644 --- a/core/Cargo.toml +++ b/core/Cargo.toml @@ -78,6 +78,7 @@ expect_used = "deny" too_many_lines = "deny" unwrap_used = "deny" wildcard_imports = "deny" +single_match_else = "deny" [dependencies] cel-interpreter = "0.10" diff --git a/core/src/bin/main.rs b/core/src/bin/main.rs index d620d78..97f54a2 100644 --- a/core/src/bin/main.rs +++ b/core/src/bin/main.rs @@ -152,13 +152,11 @@ fn run_init(dir: &Path) -> io::Result<()> { /// session directories accumulate indefinitely. `steplock clean` flushes them all. /// The next hook invocation will start each checklist fresh. fn run_clean(dir: &Path) -> io::Result<()> { - let steplock_dir = match find_repo_root_from(dir) { - Some(root) => root.join(".steplock"), - None => { - println!("steplock: no .steplock/ directory found — nothing to clean"); - return Ok(()); - } + let Some(root) = find_repo_root_from(dir) else { + println!("steplock: no .steplock/ directory found — nothing to clean"); + return Ok(()); }; + let steplock_dir = root.join(".steplock"); let sessions_dir = steplock_dir.join("sessions"); if !sessions_dir.exists() { println!("steplock: no sessions to clean");