From c615d8f16a49cfb8fd01afceb8cff5940560ab4f Mon Sep 17 00:00:00 2001 From: Pcornat Date: Thu, 8 Dec 2022 22:08:30 +0100 Subject: [PATCH] Less lines :p --- src/prob4/mod.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/prob4/mod.rs b/src/prob4/mod.rs index 02c29dc..ccc74ba 100644 --- a/src/prob4/mod.rs +++ b/src/prob4/mod.rs @@ -4,7 +4,7 @@ fn mutual_inclusion(first_pair: &[u32], second_pair: &[u32]) -> bool { } pub fn solve_part1(file_path: &str) -> i32 { - let result = std::fs::read_to_string(file_path) + std::fs::read_to_string(file_path) .expect("Please provide a text file as an argument.") .lines() .map(|line| { @@ -35,6 +35,7 @@ pub fn solve_part1(file_path: &str) -> i32 { 0 } }) - .collect::>(); - result.iter().sum() + .collect::>() + .iter() + .sum() }