From 94774010d0197ac326b83adce31acb89bd36fb62 Mon Sep 17 00:00:00 2001 From: Joe Ardent Date: Tue, 25 Oct 2022 15:12:31 -0700 Subject: [PATCH] silence lint --- where_will_the_ball_fall/src/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/where_will_the_ball_fall/src/main.rs b/where_will_the_ball_fall/src/main.rs index 85d994e..aadce8c 100644 --- a/where_will_the_ball_fall/src/main.rs +++ b/where_will_the_ball_fall/src/main.rs @@ -2,7 +2,7 @@ fn find_ball(grid: Vec>) -> Vec { let balls = grid[0].len(); let mut res = vec![-1; balls]; - for ball in 0..balls { + (0..balls).for_each(|ball| { let mut pos = ball; let mut stuck = false; for row in grid.iter() { @@ -16,7 +16,7 @@ fn find_ball(grid: Vec>) -> Vec { if !stuck { res[ball] = pos as i32; } - } + }); res }