Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unnecessary_conversion_for_trait false positive #1531

Open
smoelius opened this issue Feb 18, 2025 · 0 comments
Open

unnecessary_conversion_for_trait false positive #1531

smoelius opened this issue Feb 18, 2025 · 0 comments
Labels
bug Something isn't working lint New lint or lint enhancement

Comments

@smoelius
Copy link
Collaborator

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);
}
@smoelius smoelius added bug Something isn't working lint New lint or lint enhancement labels Feb 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working lint New lint or lint enhancement
Projects
None yet
Development

No branches or pull requests

1 participant