Skip to content

Potential FN with map_identity lint #7189

Closed
@fanninpm

Description

@fanninpm

Lint name: map_identity

I tried this code: (Originally posted by @coolreader18 in RustPython/RustPython#2627 (comment))

        self.dict
            .entries
            .next_entry(&mut self.position)
            .map(|(key, value)| (key, value))

I expected to see this happen: Clippy recognizing that this map is an identity function.

Instead, this happened: Clippy has no comment.

Meta

  • cargo clippy -V: clippy 0.1.52 (88f19c6 2021-05-03)
  • rustc -Vv:
    rustc 1.46.0-nightly (f455e46ea 2020-06-20)
    binary: rustc
    commit-hash: f455e46eae1a227d735091091144601b467e1565
    commit-date: 2020-06-20
    host: x86_64-unknown-linux-gnu
    release: 1.46.0-nightly
    LLVM version: 10.0
    

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: Clippy is not doing the correct thingI-false-negativeIssue: The lint should have been triggered on code, but wasn't

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions