-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
New lint: redundant_slicing #6528
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @flip1995 (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but I'm not sure why you would ever want to do that.
If I learned anything from maintaining Clippy, it is that someone out there always does something you don't expect. But your argument that this should be noted in the code is correct. And what better way to note this than with a clippy-allow?
☔ The latest upstream changes (presumably #6538) made this pull request unmergeable. Please resolve the merge conflicts. |
f263f49
to
dd67407
Compare
dd67407
to
c379af0
Compare
☔ The latest upstream changes (presumably #6500) made this pull request unmergeable. Please resolve the merge conflicts. |
Co-authored-by: Philipp Krones <hello@philkrones.com>
be09693
to
9146a77
Compare
@bors r+ Thanks! |
📌 Commit 9146a77 has been approved by |
☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
changelog: Added lint:
redundant_slicing
fixes #6519
This will trigger on any type which implements
Index<RangeFull>
that returns the input type. This would be a false positive if the implementation does something other than return itself, but I'm not sure why you would ever want to do that.