Skip to content

Commit 9573a0d

Browse files
committed
Rename variables
1 parent 13c207d commit 9573a0d

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

clippy_lints/src/loops.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1539,18 +1539,18 @@ fn check_for_loop_explicit_counter<'tcx>(
15391539
expr: &'tcx Expr<'_>,
15401540
) {
15411541
// Look for variables that are incremented once per loop iteration.
1542-
let mut visitor = IncrementVisitor::new(cx);
1543-
walk_expr(&mut visitor, body);
1542+
let mut increment_visitor = IncrementVisitor::new(cx);
1543+
walk_expr(&mut increment_visitor, body);
15441544

15451545
// For each candidate, check the parent block to see if
15461546
// it's initialized to zero at the start of the loop.
15471547
if let Some(block) = get_enclosing_block(&cx, expr.hir_id) {
1548-
for id in visitor.into_results() {
1549-
let mut visitor2 = InitializeVisitor::new(cx, expr, id);
1550-
walk_block(&mut visitor2, block);
1548+
for id in increment_visitor.into_results() {
1549+
let mut initialize_visitor = InitializeVisitor::new(cx, expr, id);
1550+
walk_block(&mut initialize_visitor, block);
15511551

15521552
if_chain! {
1553-
if let Some((name, initializer)) = visitor2.get_result();
1553+
if let Some((name, initializer)) = initialize_visitor.get_result();
15541554
if is_integer_const(cx, initializer, 0);
15551555
then {
15561556
let mut applicability = Applicability::MachineApplicable;

0 commit comments

Comments
 (0)