-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Add lint to detect manual slice copies #2021
Conversation
c31f447
to
90f345d
Compare
It looks like you actually ran both (first nightly, then stable).
So I applied the method that I'd desire in situations like these directly to the PR:
This makes it really easy to see the changes you did in the last commit, since the ui-tests don't show any line change noise |
Did you ever address
in the previous PR? This PR looks good to me with the suggestion fixed to produce the same semantics as the loop. |
Thanks for the commits (I didn't know that was possible!) and the guidance! I did address the panic situation. The destination slice should now always be as long as the source slice, although I did not make a separate commit for it. |
Great! Another lint that will have a positive impact on many projects. So much cool stuff in clippy lately |
👍 |
Wow this is a pretty sweet lint |
This PR replaces #1937.
Addresses issue #1831.
I see there are still some formatting issues. This PR has been formatted with the latest rustfmt (stable). I am receptive to instructions on how to fix these.