From 7ea1b80afea7366a995ee35425fd8f22940098bf Mon Sep 17 00:00:00 2001 From: "max.nuding" Date: Mon, 12 Dec 2022 14:20:10 +0100 Subject: [PATCH] renamed row --- src/day12/mod.rs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/day12/mod.rs b/src/day12/mod.rs index 9d6eebd..16cf78d 100644 --- a/src/day12/mod.rs +++ b/src/day12/mod.rs @@ -14,20 +14,20 @@ pub fn run() { let mut target: Coord = Default::default(); let map = lines .enumerate() - .map(|(r, l)| { + .map(|(row, l)| { l.chars() .enumerate() .map(|(col, c)| match c { 'S' => { start = Coord { - row: r, + row, col, }; 0 } 'E' => { target = Coord { - row: r, + row, col, }; 25 @@ -45,7 +45,7 @@ pub fn run() { #[cfg(feature = "part2")] { - let starting_points = map + let min = map .iter() .enumerate() .flat_map(|(row, v)| { @@ -58,9 +58,6 @@ pub fn run() { }) .collect_vec() }) - .collect_vec(); - let min = starting_points - .iter() .filter_map(|start| bfs(&map, start.clone(), target.clone())) .min() .unwrap();