Skip to content

Commit 9d465d8

Browse files
committed
Day 16
1 parent 66c2395 commit 9d465d8

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/bin/16.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -183,10 +183,12 @@ pub fn part_two(input: &str) -> Option<u64> {
183183
s.dir = dir;
184184
q.push_back(s);
185185
}
186-
_ => {
187-
for (idx, &is_viable) in viable_options.iter().enumerate() {
186+
_ => viable_options
187+
.iter()
188+
.enumerate()
189+
.for_each(|(idx, &is_viable)| {
188190
if !is_viable {
189-
continue;
191+
return;
190192
}
191193

192194
let (pos, dir, cost) = all_options[idx];
@@ -200,8 +202,7 @@ pub fn part_two(input: &str) -> Option<u64> {
200202
cost,
201203
};
202204
q.push_back(new_state);
203-
}
204-
}
205+
}),
205206
}
206207
}
207208

0 commit comments

Comments
 (0)