-
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
fix: [manual_memcpy] reduce indexing suggestions when array length is equal to loop range #11778
fix: [manual_memcpy] reduce indexing suggestions when array length is equal to loop range #11778
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @blyxyas (or someone else) soon. Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (
|
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.
Pretty good first iteration, just some minor fixes and I think this should be merge-ready!
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.
LGTM, Thanks for you first contribution and welcome to Clippy! ❤️
Could you please squash these 4 commits into a single one?
4e85e41
to
cb528e7
Compare
It appears that the |
…oop range Format refactor: extract function to shrink function length fix: remove cmp to calculate range fix: replace if_chain with let chains
cb528e7
to
a9d42e6
Compare
I squashed my commits into one, and I really appreciate your guidance! |
@bors r+ |
☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
fixes: #11689
This PR improves
manual_memcpy
suggestions by reducing unnecessary indexing.For example,
Clippy suggests
dest[..4].copy_from_slice(&src[..4]);
.I reduced this suggestion as
dest.copy_from_slice(&src[..4]);
. (Removed needless indexing.)changelog: [
manual_memcpy
]: Reduce indexing suggestions when array length is equal to loop range