Clean up part 2

This commit is contained in:
pjht 2022-12-07 13:25:45 -06:00
parent 0b9a1061a0
commit 42c911c9a2

View File

@ -135,8 +135,8 @@ fn solve_part2(input: &[CliOperation]) -> usize {
let necessary_to_free = 30_000_000 - free_space; let necessary_to_free = 30_000_000 - free_space;
tree.traverse_post_order(tree.root_node_id().unwrap()) tree.traverse_post_order(tree.root_node_id().unwrap())
.unwrap() .unwrap()
.filter(|node| node.data().1 >= necessary_to_free)
.map(|node| node.data().1) .map(|node| node.data().1)
.filter(|&size| size >= necessary_to_free)
.min() .min()
.unwrap() .unwrap()
} }