Skip to content

main.rs:954: cmd_doctor() returns Result<i32> but never Err — clippy::unnecessary_wraps #354

Description

@EffortlessSteven

Location: crates/diffguard/src/main.rs:954

Problem: fn cmd_doctor(args: DoctorArgs) -> Result<i32> — clippy pedantic warns this is an unnecessary wrap. Every caller of ? on this function would always get Ok. The function never returns Err.

Fix: Change return type to Ok<i32> (still wraps Ok, just no Err variant needed), or change to -> i32 and use Ok(0)/Ok(1) explicitly, or add #[allow(clippy::unnecessary_wraps)] if there is a structural reason (e.g., future-proofing for multi-check refactor).

This is a legitimate API design issue — a function that can never fail should not pretend it might.

Metadata

Metadata

Assignees

No one assigned

    Labels

    backlogBacklog — not currently prioritized, TBD

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions