From ba1685e77536ed1530979de43e62de5181fee6e3 Mon Sep 17 00:00:00 2001 From: Greg Burri Date: Sat, 3 Dec 2022 17:14:53 +0100 Subject: [PATCH] Remove useless import --- src/day03.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/day03.rs b/src/day03.rs index a15f11b..5deba68 100644 --- a/src/day03.rs +++ b/src/day03.rs @@ -1,4 +1,4 @@ -use std::io::{BufRead, Lines}; +use std::io::BufRead; use itertools::Itertools; @@ -32,18 +32,18 @@ where R: BufRead { let mut sum = 0; - let mut item_count = [0i32; 52]; + let mut item_set = [0u8; 52]; for group in reader.lines().chunks(3).into_iter() { - item_count.fill(0); + item_set.fill(0); for (i, rucksack) in group.enumerate() { let items = rucksack.unwrap(); for b in items.as_bytes().into_iter() { let v = letter_to_priority(*b); - if i == 2 && item_count[v as usize - 1] == 3 { + if i == 2 && item_set[v as usize - 1] == 3 { sum += v as i32; break; } - item_count[v as usize - 1] |= 1 << i; + item_set[v as usize - 1] |= 1 << i; } } } -- 2.45.2