Skip to content

feat(core): enable clippy::unnecessary_wraps (#160)#164

Open
tupe12334 wants to merge 1 commit into
mainfrom
fix/issue-160-unnecessary-wraps
Open

feat(core): enable clippy::unnecessary_wraps (#160)#164
tupe12334 wants to merge 1 commit into
mainfrom
fix/issue-160-unnecessary-wraps

Conversation

@tupe12334

Copy link
Copy Markdown
Member

What

Enables the clippy::unnecessary_wraps lint by promoting it to deny in core/Cargo.toml, continuing the project's incremental lint-ratcheting policy (one lint promoted per PR).

The single violation it surfaces

run_validate() in core/src/bin/main.rs declared io::Result<bool> but always returned Ok(...) and never Err. The fallible signature was dead weight, forcing the validate command call site to handle an error case that could never occur.

Fix: changed the return type to plain bool, which:

  • drops the unreachable Err(e) => … arm at the call site (now a simple if !run_validate(&root) { process::exit(1); }),
  • removes the .unwrap() calls in the eight related unit tests.

Verification

cargo clippy --manifest-path core/Cargo.toml --all-targets --locked -- -D warnings   # clean
cargo test  --manifest-path core/Cargo.toml --locked                                  # 146 passed, 0 failed
cargo fmt   --manifest-path core/Cargo.toml -- --check                                 # clean

Closes #160


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

Promotes `clippy::unnecessary_wraps` to `deny` in core/Cargo.toml,
continuing the incremental lint-ratcheting policy.

The single violation it surfaces is `run_validate()` in
core/src/bin/main.rs, which declared `io::Result<bool>` but always
returned `Ok(...)` and never `Err`. Changed its return type to plain
`bool`, dropping the dead error arm at the `validate` command call site
and the `.unwrap()` calls in the related tests.

Closes #160

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::unnecessary_wraps lint

1 participant