Skip to content

len_zero: also handle .len() >= 1  #2554

@matthiaskrgr

Description

@matthiaskrgr

Since .len() should return unsigned values in most cases, I think we can treat .len() >= 1 the same as .len() != 0 or am I missing something?

if String::from("hello").len() >= 1 {}

does not trigger a warning currently.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-enhancementCategory: Enhancement of lints, like adding more cases or adding help messagesT-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