Improve lint message
Remove trailing period and include snippet of loop argument.
This commit is contained in:
parent
1e320b38c1
commit
6b57924e81
@ -146,9 +146,9 @@ impl LintPass for LoopsPass {
|
||||
if let Some(name) = visitor2.name {
|
||||
span_lint(cx, EXPLICIT_COUNTER_LOOP, expr.span,
|
||||
&format!("the variable `{0}` is used as a loop counter. Consider \
|
||||
using `for ({0}, item) in _.iter().enumerate()` \
|
||||
or similar iterators.",
|
||||
name));
|
||||
using `for ({0}, item) in {1}.enumerate()` \
|
||||
or similar iterators",
|
||||
name, snippet(cx, arg.span, "_")));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user