Skip to content

chore(lint): enable clippy::single_match_else#159

Open
tupe12334 wants to merge 1 commit into
mainfrom
clippy/enable-single_match_else
Open

chore(lint): enable clippy::single_match_else#159
tupe12334 wants to merge 1 commit into
mainfrom
clippy/enable-single_match_else

Conversation

@tupe12334

Copy link
Copy Markdown
Member

Closes #158

Enables clippy::single_match_else (pedantic) as deny in core/Cargo.toml, continuing the incremental Clippy ratchet.

What the lint catches

A two-arm match where one arm is trivial/catch-all + an else block — clearer as if let { } else { } or let … else { }.

Change

  • core/Cargo.toml: add single_match_else = "deny".
  • core/src/bin/main.rs: rewrite the one violation in run_clean as a let … else, dropping a level of nesting:
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");

Verification (matches CI)

  • cargo fmt --manifest-path core/Cargo.toml -- --check
  • cargo clippy --manifest-path core/Cargo.toml --all-targets --locked -- -D warnings
  • cargo test --manifest-path core/Cargo.toml --locked ✅ (5 passed)
  • RUSTDOCFLAGS="-D warnings" cargo doc --manifest-path core/Cargo.toml --no-deps --locked

One lint, one fix, no other lints touched.

🤖 Generated with Claude Code

Promote clippy::single_match_else to deny (one more step in the
incremental Clippy ratchet). Rewrite the single violation in
run_clean as a let-else, which expresses the "extract or bail"
intent more directly than a two-arm match.

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