Skip to content

Lint .into_iter() if that only forwards to .iter() #1565

Closed
@oli-obk

Description

@oli-obk

cc @bluss

Types like [T; N] don't implement IntoIter themselves, but instead provide it through their Deref<Target=[T]> impl, which is simply a wrapper around calling .iter().

.into_iter() suggests that some ownership transfer is going on, if that is not the case .iter() should be used.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-enhancementCategory: Enhancement of lints, like adding more cases or adding help messagesE-mediumCall for participation: Medium difficulty level problem and requires some initial experience.L-unnecessaryLint: Warn about unnecessary codeT-middleType: Probably requires verifiying types

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions