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 {
|
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.")
|
.expect("Please provide a text file as an argument.")
|
||||||
.lines()
|
.lines()
|
||||||
.map(|line| {
|
.map(|line| {
|
||||||
@ -35,6 +35,7 @@ pub fn solve_part1(file_path: &str) -> i32 {
|
|||||||
0
|
0
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.collect::<Vec<i32>>();
|
.collect::<Vec<i32>>()
|
||||||
result.iter().sum()
|
.iter()
|
||||||
|
.sum()
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user