diff --git a/2022/rust/src/day6.rs b/2022/rust/src/day6.rs index 91a7dec..e65beae 100644 --- a/2022/rust/src/day6.rs +++ b/2022/rust/src/day6.rs @@ -26,8 +26,9 @@ fn part1(c: &Input) -> Result { } fn part2(c: &Input) -> Result { + let mut s: HashSet = HashSet::with_capacity(14); for i in 13..c.len() { - let mut s: HashSet = HashSet::new(); + s.clear(); for j in i - 13..=i { s.insert(c[j]); }