Skip to content

Enable clippy::single_match_else lint #158

Description

@tupe12334

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions