Skip to content

len_without_is_empty lints if len and is_empty are in different impl blocks #1562

Closed
@oli-obk

Description

@oli-obk

The following code triggers the len_without_is_empty lint.

impl Foo {
    fn len(&self) -> usize { 0 }
}
impl Foo {
    fn is_empty(&self) -> bool { true }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: Clippy is not doing the correct thing

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions