Merge pull request #186 from birkenfeld/fix
loops: fix two trailing periods in lint msgs
This commit is contained in:
commit
65deb956f1
@ -39,12 +39,12 @@ impl LintPass for LoopsPass {
|
|||||||
if visitor.nonindex {
|
if visitor.nonindex {
|
||||||
span_lint(cx, NEEDLESS_RANGE_LOOP, expr.span, &format!(
|
span_lint(cx, NEEDLESS_RANGE_LOOP, expr.span, &format!(
|
||||||
"the loop variable `{}` is used to index `{}`. Consider using \
|
"the loop variable `{}` is used to index `{}`. Consider using \
|
||||||
`for ({}, item) in {}.iter().enumerate()` or similar iterators.",
|
`for ({}, item) in {}.iter().enumerate()` or similar iterators",
|
||||||
ident.node.name, indexed, ident.node.name, indexed));
|
ident.node.name, indexed, ident.node.name, indexed));
|
||||||
} else {
|
} else {
|
||||||
span_lint(cx, NEEDLESS_RANGE_LOOP, expr.span, &format!(
|
span_lint(cx, NEEDLESS_RANGE_LOOP, expr.span, &format!(
|
||||||
"the loop variable `{}` is only used to index `{}`. \
|
"the loop variable `{}` is only used to index `{}`. \
|
||||||
Consider using `for item in &{}` or similar iterators.",
|
Consider using `for item in &{}` or similar iterators",
|
||||||
ident.node.name, indexed, indexed));
|
ident.node.name, indexed, indexed));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user