Skip to content

Lint unsigned - other_unsigned > 0 #588

@fhartwig

Description

@fhartwig

Idea from here.
Basically, x - y, where x and y are of some unsigned integer type, returns 0 iff x == y, so comparing the difference to 0 is dodgy and should at least be rewritten for clarity.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-lintArea: New lintsL-correctnessLint: Belongs in the correctness lint groupS-needs-discussionStatus: Needs further discussion before merging or work can be startedT-middleType: Probably requires verifiying typesgood first issueThese issues are a good way to get started with Clippy

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions