From c53f8823dcd682de92cb9ba8d640558b48fc571a Mon Sep 17 00:00:00 2001 From: Daniel Flanagan Date: Mon, 5 Dec 2022 23:30:33 -0600 Subject: [PATCH] White fang --- 2022/rust/src/day6.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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]); }