needless_range_loop: improve documentation
This commit is contained in:
parent
96c28d1f69
commit
4d266d31de
3 changed files with 7 additions and 6 deletions
|
|
@ -61,7 +61,8 @@ declare_clippy_lint! {
|
|||
///
|
||||
/// ### Why is this bad?
|
||||
/// Just iterating the collection itself makes the intent
|
||||
/// more clear and is probably faster.
|
||||
/// more clear and is probably faster because it eliminates
|
||||
/// the bounds check that is done when indexing.
|
||||
///
|
||||
/// ### Example
|
||||
/// ```rust
|
||||
|
|
|
|||
|
|
@ -149,7 +149,7 @@ pub(super) fn check<'tcx>(
|
|||
|diag| {
|
||||
multispan_sugg(
|
||||
diag,
|
||||
"consider using an iterator",
|
||||
"consider using an iterator and enumerate",
|
||||
vec![
|
||||
(pat.span, format!("({}, <item>)", ident.name)),
|
||||
(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue