Skip to content

explicit_iter_loop should warn &[T].iter() #1518

Closed
@malbarbo

Description

@malbarbo
fn main() {
    let s = &[1, 2, 3, 4];
    for a in s.iter() { // .iter() is not necessary
        println!("{:?}", a);
    }
}

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'tT-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