return Result

This commit is contained in:
Antoine Martin 2019-11-14 19:16:49 +01:00
parent b80637585b
commit ecfd0c10bf
2 changed files with 10 additions and 12 deletions

View file

@ -14,12 +14,12 @@ fn main() -> Result<()> {
.expect("Please provide the path to the input file"),
)?;
part1(&input)?;
println!("part 1: {}", part1(&input)?);
Ok(())
}
fn part1(input: &str) -> Result<()> {
fn part1(input: &str) -> Result<u32> {
let mut twice = 0;
let mut thrice = 0;
@ -38,7 +38,5 @@ fn part1(input: &str) -> Result<()> {
}
}
println!("{}", twice * thrice);
Ok(())
Ok(twice * thrice)
}