Skip to content

Enable clippy::unnecessary_wraps lint #160

Description

@tupe12334

Summary

Enable the clippy::unnecessary_wraps lint by adding it to the [lints.clippy] table in core/Cargo.toml.

This continues the project's incremental lint-ratcheting policy (one lint promoted to deny per PR).

What the lint catches

clippy::unnecessary_wraps flags functions that always return Ok(...) (or Some(...)) and never return Err/None, yet declare a Result<T> / Option<T> return type. The wrapper type is dead weight: it forces every caller to handle an error case that can never occur.

Why it improves code quality

  • Honest signatures — the return type should reflect what the function can actually do. A function that never fails should not advertise fallibility.
  • Less caller boilerplate — removes pointless ?, .unwrap(), and match Ok/Err arms at call sites.
  • Smaller error surface — fewer spurious error paths to reason about and test.

Current state

Baseline cargo clippy --all-targets is clean. Enabling this lint surfaces exactly one real violation:

  • core/src/bin/main.rsrun_validate() returns io::Result<bool> but never returns Err; all branches return Ok(...).

The accompanying PR enables the lint and fixes that single function (returning plain bool), simplifying the validate command's call site and the related tests.


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

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