From af6709d2a819b68e8f15d9ac4c6c6dac27f452b2 Mon Sep 17 00:00:00 2001 From: Tyler Hallada Date: Fri, 15 Feb 2019 23:48:12 -0500 Subject: [PATCH] Rustfmt day 8 --- src/day8.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/day8.rs b/src/day8.rs index 1077516..4d1c428 100644 --- a/src/day8.rs +++ b/src/day8.rs @@ -19,10 +19,7 @@ pub fn solve_part2() -> Result { fn read_license(filename: &str) -> Result> { let license = fs::read_to_string(filename)?; let license = license.trim(); - Ok(license - .split(' ') - .map(|num| num.parse().unwrap()) - .collect()) + Ok(license.split(' ').map(|num| num.parse().unwrap()).collect()) } fn sum_metadata(license: &[u32], mut index: usize, mut sum_acc: u32) -> (u32, usize) { @@ -63,7 +60,6 @@ fn sum_metadata_with_indices(license: &[u32], mut index: usize) -> (u32, usize) .map(|num| *child_sums.get(*num as usize - 1).unwrap_or(&0)) .sum(); index += num_metadata as usize; - } } else if num_metadata != 0 { sum = license[index..index + num_metadata as usize].iter().sum();