Skip to content

Conversation

elliottneilclark
Copy link
Contributor

This should close #1094.

@@ -577,6 +596,16 @@ fn check_for_loop_arg(cx: &LateContext, pat: &Pat, arg: &Expr, expr: &Expr) {
object,
method_name));
}
} else if method_name.as_str() == "into_iter" && match_trait_method(cx, arg, &paths::I) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be INTO_ITERATOR

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah miss commit.

@@ -87,7 +87,7 @@ impl Unrelated {
}
}

#[deny(needless_range_loop, explicit_iter_loop, iter_next_loop, reverse_range_loop, explicit_counter_loop)]
#[deny(needless_range_loop, explicit_iter_loop, explicit_into_iter_loop, iter_next_loop, reverse_range_loop, explicit_counter_loop)]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We usually just do #[deny(clippy)]. I wonder why this file does not use that.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't know for sure. Let me clean that up in a separate pr.

@@ -294,6 +294,10 @@ fn main() {
for _v in vec.iter() { } //~ERROR it is more idiomatic to loop over `&vec`
for _v in vec.iter_mut() { } //~ERROR it is more idiomatic to loop over `&mut vec`


let mut _out_vec = vec![1,2,3];
Copy link
Contributor

@mcarton mcarton Oct 1, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why a leading _ here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not needed. Let me remove it.

@mcarton mcarton merged commit 8babb2d into rust-lang:master Oct 1, 2016
@mcarton
Copy link
Contributor

mcarton commented Oct 1, 2016

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

lint unnecessary .into_iter()
2 participants