Skip to content

unnecessary_conversion_for_trait false positive #1531

@smoelius

Description

@smoelius

unnecessary_conversion_for_trait recommends to remove the iter in the call to extend. But then xs would be unavailable for the call to println!.

fn main() {
    let xs = vec![[0u8; 16]];
    let mut ys: Vec<[u8; 16]> = Vec::new();
    ys.extend(xs.iter());
    //          ^^^^^^^
    println!("{:?}", xs);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinglintNew lint or lint enhancement

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions