Less lines :p
This commit is contained in:
parent
befbc009cc
commit
c615d8f16a
@ -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::<Vec<i32>>();
|
||||
result.iter().sum()
|
||||
.collect::<Vec<i32>>()
|
||||
.iter()
|
||||
.sum()
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user