-
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
[explicit_counter_loop] suggests .into_iter()
, despite that triggering [into_iter_on_ref] in some cases
#8382
[explicit_counter_loop] suggests .into_iter()
, despite that triggering [into_iter_on_ref] in some cases
#8382
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @giraffate (or someone else) soon. 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.
Overall looks good.
clippy_lints/src/loops/utils.rs
Outdated
let arg_ty = cx.typeck_results().expr_ty_adjusted(arg); | ||
match &arg_ty.kind() { | ||
ty::Ref(_, inner_ty, mutbl) if has_iter_method(cx, inner_ty).is_some() => { | ||
let meth_name = match mutbl { |
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.
nits
let meth_name = match mutbl { | |
let method_name = match mutbl { |
@giraffate Thank you for your code review. I have modified code. |
@bors r+ Thanks! |
📌 Commit f5fd9de has been approved by |
☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
I have modified
fn make_iterator_snippet
in clippy_lints/src/loops/utils.rs ,so this change has some little influence on another lint [manual_flatten] .fixes #8155
changelog: Fix that [
explicit_counter_loop
] suggestsinto_iter()
despite that triggering [into_iter_on_ref
] in some cases