Skip to content

chore(lint): enable clippy::unnecessary_wraps#161

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

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

Conversation

@tupe12334

Copy link
Copy Markdown
Member

What

Enables the clippy::unnecessary_wraps lint (deny) in core/Cargo.toml, continuing the project's incremental lint-ratcheting policy.

Why

clippy::unnecessary_wraps flags functions that always return Ok(...)/Some(...) and never Err/None, while still declaring a Result/Option return type. Such signatures are dishonest and push needless error-handling boilerplate onto every caller.

Changes

  • core/Cargo.toml — add unnecessary_wraps = "deny" to [lints.clippy].
  • core/src/bin/main.rs — the lint surfaced one real violation: run_validate() returned io::Result<bool> but never returned Err (no fallible I/O — validate_checklists returns a Vec of errors, not a Result). Changed it to return plain bool:
    • simplified the validate command call site (match Ok/Errif !run_validate(...)),
    • dropped the now-unnecessary .unwrap() from the related tests,
    • updated the doc comment.

Verification

  • cargo clippy --all-targets — clean.
  • cargo test — all 146 tests pass.

Closes #160


This pull request was opened by the "Clippy lint improvements → issue + PR (Rust repos) → Slack" routine of moadim.

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

The lint surfaced one violation: run_validate returned io::Result<bool>
but never returned Err. Change it to return plain bool, simplify the
validate command call site, and drop the now-unnecessary .unwrap() from
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