diff --git a/2023/day04/src/p2ascii.rs b/2023/day04/src/p2ascii.rs index ae5f530..1d43cb0 100644 --- a/2023/day04/src/p2ascii.rs +++ b/2023/day04/src/p2ascii.rs @@ -6,7 +6,7 @@ fn line_match_count(line: &str) -> usize { .split_ascii_whitespace() .collect::>(); - let you_have = numbers.next().unwrap().split_ascii_whitespace(); + let you_have = numbers.next().unwrap().split_ascii_whitespace(); you_have .filter(|have| winning.iter().any(|w| w == have)) diff --git a/2023/day04/src/p2chunks.rs b/2023/day04/src/p2chunks.rs index ce44d2e..938f8f5 100644 --- a/2023/day04/src/p2chunks.rs +++ b/2023/day04/src/p2chunks.rs @@ -4,7 +4,11 @@ fn line_match_count(line: &str) -> usize { ((chunk[1] as u16) << 8) | (chunk[2] as u16) } - let mut numbers = line.split(|&b| b == b':').nth(1).unwrap().split(|&b| b == b'|'); + let mut numbers = line + .split(|&b| b == b':') + .nth(1) + .unwrap() + .split(|&b| b == b'|'); let winning = numbers .next() .unwrap() diff --git a/2023/day04/src/p2no_alloc.rs b/2023/day04/src/p2no_alloc.rs index 15d0b7d..a09ad99 100644 --- a/2023/day04/src/p2no_alloc.rs +++ b/2023/day04/src/p2no_alloc.rs @@ -6,7 +6,7 @@ fn line_match_count(line: &str) -> usize { .split_whitespace() .collect::>(); - let you_have = numbers.next().unwrap().split_whitespace(); + let you_have = numbers.next().unwrap().split_whitespace(); you_have .filter(|have| winning.iter().any(|w| w == have)) diff --git a/2023/day05/src/p2basic.rs b/2023/day05/src/p2basic.rs index 7833961..6ee3625 100644 --- a/2023/day05/src/p2basic.rs +++ b/2023/day05/src/p2basic.rs @@ -46,7 +46,8 @@ pub fn part2(input: &str) -> u64 { current_seeds.push((stage, range_idx + 1, post)); } let offset = in_.start - range.source_start; - let new = (range.dest_start + offset)..(range.dest_start + offset + (in_.end - in_.start)); + let new = + (range.dest_start + offset)..(range.dest_start + offset + (in_.end - in_.start)); if !new.is_empty() { current_seeds.push((stage + 1, 0, new)); diff --git a/2023/day06/src/lib.rs b/2023/day06/src/lib.rs index d3c9173..c258398 100644 --- a/2023/day06/src/lib.rs +++ b/2023/day06/src/lib.rs @@ -97,6 +97,4 @@ helper::tests! { default => 28545089; } } -helper::benchmarks! { - -} +helper::benchmarks! {} diff --git a/2023/day08/src/lib.rs b/2023/day08/src/lib.rs index 0eca887..3bcd634 100644 --- a/2023/day08/src/lib.rs +++ b/2023/day08/src/lib.rs @@ -31,7 +31,6 @@ impl Day for Day08 { } } - helper::tests! { day08 Day08; part1 {