From: Greg Burri Date: Sat, 3 Dec 2022 16:14:53 +0000 (+0100) Subject: Remove useless import X-Git-Url: http://git.euphorik.ch/index.cgi?a=commitdiff_plain;h=ba1685e77536ed1530979de43e62de5181fee6e3;p=advent_of_code_2022.git Remove useless import --- 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; } } }