Rustfmt day 5
This commit is contained in:
parent
106e85cf50
commit
e6078af973
1 changed files with 8 additions and 2 deletions
10
day05.rs
10
day05.rs
|
@ -39,7 +39,10 @@ fn transform_ranges(map: &[(u64, u64, u64)], ranges: &[(u64, u64)]) -> Vec<(u64,
|
|||
let end = start + length;
|
||||
let src_end = src_start + len;
|
||||
|
||||
output_ranges.push((dst_start + start - src_start, u64::min(src_end, end) - start));
|
||||
output_ranges.push((
|
||||
dst_start + start - src_start,
|
||||
u64::min(src_end, end) - start,
|
||||
));
|
||||
if end > src_end {
|
||||
output_ranges.extend(transform_ranges(map, &[(src_end, end - src_end)]));
|
||||
}
|
||||
|
@ -70,7 +73,10 @@ fn main() -> io::Result<()> {
|
|||
let maps: Vec<Vec<_>> = (0..7).map(|_| parse_map(&mut lines)).collect();
|
||||
|
||||
let part1 = do_the_thing(&maps, seeds.iter().map(|&seed| (seed, 1)).collect());
|
||||
let part2 = do_the_thing(&maps, seeds.chunks(2).map(|chunk| (chunk[0], chunk[1])).collect());
|
||||
let part2 = do_the_thing(
|
||||
&maps,
|
||||
seeds.chunks(2).map(|chunk| (chunk[0], chunk[1])).collect(),
|
||||
);
|
||||
dbg!(part1, part2);
|
||||
|
||||
Ok(())
|
||||
|
|
Loading…
Reference in a new issue