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

unused or repeated assign to the same index #13908

Open
bingmatv opened this issue Dec 30, 2024 · 0 comments
Open

unused or repeated assign to the same index #13908

bingmatv opened this issue Dec 30, 2024 · 0 comments
Labels
A-lint Area: New lints

Comments

@bingmatv
Copy link

What it does

To detect whether the index is the same and whether there's unused or repeated assign.

Advantage

No response

Drawbacks

No response

Example

fn main() {
    let mut a = [0u8; 8];
    a[0] = 1;
    a[0] = 1;
    a[0..3].copy_from_slice(&[1; 3]);
}

Clippy didn't warn there are repeated assign to the index 0.

@bingmatv bingmatv added the A-lint Area: New lints label Dec 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-lint Area: New lints
Projects
None yet
Development

No branches or pull requests

1 participant