From 12b55d79be2683218767f9b1c83effc368e086b4 Mon Sep 17 00:00:00 2001 From: vintitres Date: Fri, 15 Sep 2023 21:02:46 +0000 Subject: [PATCH] clippy --- src/day16.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/day16.rs b/src/day16.rs index 0236ada..95ab79f 100644 --- a/src/day16.rs +++ b/src/day16.rs @@ -121,7 +121,7 @@ fn consolidate(valves: &BTreeMap) -> BTreeMap { pub fn part1(input: &str) -> i64 { let valves = consolidate(&BTreeMap::from_iter(input.lines().map(Valve::read))); - let allflow = valves.iter().map(|(_, v)| v.flow_rate).sum(); + let allflow = valves.values().map(|v| v.flow_rate).sum(); let mut bestflow = 1500; dfs( &valves, @@ -139,7 +139,7 @@ pub fn part1(input: &str) -> i64 { pub fn part2(input: &str) -> i64 { let valves = consolidate(&BTreeMap::from_iter(input.lines().map(Valve::read))); - let allflow = valves.iter().map(|(_, v)| v.flow_rate).sum(); + let allflow = valves.values().map(|v| v.flow_rate).sum(); let mut bestflow = 0; dfs( &valves,