Promote one more Clippy lint to deny (per the repo's incremental ratchet documented in .steplock/checklists/pre-push).
Lint: clippy::single_match_else
What it catches: a match with exactly two arms where one arm is a trivial/catch-all (_ or a binding) followed by an else-style block. These read more clearly as an if let { } else { } or, when the else diverges, a let … else { }.
Why it improves code quality:
match is heavier syntax than needed for a binary "one pattern vs. everything else" decision. if let / let … else express the intent more directly.
- Reduces nesting and rightward drift, especially when the fallback arm just logs and returns.
- Keeps a consistent idiom across the crate for "extract this value or bail."
Current violation (1): core/src/bin/main.rs run_clean matches find_repo_root_from(dir) only to early-return on None — a textbook let … else.
This is a pedantic-group lint; enabling it as deny matches how the other pedantic lints are already configured in core/Cargo.toml.
The PR enabling it fixes the single existing violation so cargo clippy --all-targets -- -D warnings stays green.
Promote one more Clippy lint to
deny(per the repo's incremental ratchet documented in.steplock/checklists/pre-push).Lint:
clippy::single_match_elseWhat it catches: a
matchwith exactly two arms where one arm is a trivial/catch-all (_or a binding) followed by anelse-style block. These read more clearly as anif let { } else { }or, when the else diverges, alet … else { }.Why it improves code quality:
matchis heavier syntax than needed for a binary "one pattern vs. everything else" decision.if let/let … elseexpress the intent more directly.Current violation (1):
core/src/bin/main.rsrun_cleanmatchesfind_repo_root_from(dir)only to early-return onNone— a textbooklet … else.This is a
pedantic-group lint; enabling it asdenymatches how the other pedantic lints are already configured incore/Cargo.toml.The PR enabling it fixes the single existing violation so
cargo clippy --all-targets -- -D warningsstays green.