Skip to content

style(lint): enable clippy::single_match_else#175

Open
tupe12334 wants to merge 1 commit into
mainfrom
fix/issue-158-single-match-else
Open

style(lint): enable clippy::single_match_else#175
tupe12334 wants to merge 1 commit into
mainfrom
fix/issue-158-single-match-else

Conversation

@tupe12334

Copy link
Copy Markdown
Member

What

Promotes clippy::single_match_else to deny (the repo's incremental lint ratchet) and fixes the single existing violation.

Why

In run_clean (src/bin/main.rs), find_repo_root_from was destructured with a match whose Some arm was trivial and whose None arm returned early. That's exactly the shape single_match_else flags. Rewritten as an idiomatic let ... else, which reads as the guard it is:

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");

Checks

  • cargo clippy --all-targets — clean
  • cargo test — 15 passed
  • cargo fmt --check — clean

Closes #158


This pull request was opened by the Open issues → fix PRs (owned repos + my orgs) routine of moadim.

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) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enable clippy::single_match_else lint

1 participant