From 408a690061b2f1014ac7a60815983a8ad15444db Mon Sep 17 00:00:00 2001 From: Andrew Coleman Date: Mon, 5 Dec 2022 09:59:07 -0500 Subject: [PATCH] cargo fmt --- 2022/src/days/day3.rs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/2022/src/days/day3.rs b/2022/src/days/day3.rs index c8f417f..f8f26ff 100644 --- a/2022/src/days/day3.rs +++ b/2022/src/days/day3.rs @@ -1,6 +1,6 @@ use anyhow::Result; -use std::fs; use std::collections::HashSet; +use std::fs; fn get_priority(t: &char) -> u32 { if t.is_ascii_uppercase() { @@ -47,14 +47,20 @@ pub fn run() -> Result<()> { let elf2map: HashSet = HashSet::from_iter(elf2.chars()); let elf3map: HashSet = HashSet::from_iter(elf3.chars()); - for dupe in elf1map.iter().filter(|t| elf2map.contains(t) && elf3map.contains(t)) { + for dupe in elf1map + .iter() + .filter(|t| elf2map.contains(t) && elf3map.contains(t)) + { rucksacks2.push(get_priority(dupe)); } } else { break; } } - println!("part two priorities {}", rucksacks2.into_iter().sum::()); + println!( + "part two priorities {}", + rucksacks2.into_iter().sum::() + ); Ok(()) }