Preface: I am learning Rust through the Advent of Code
The task is to read lines from a file, parse each as an integer, then provide a summation of all the numbers. My solution looks like this:
use std::fs::File;
use std::io::{self, prelude::*, BufReader};
fn main() -> io::Result<()> {
    let file = File::open("day01.txt")?;
    let reader = BufReader::new(file);
    let mut sum: i32 = 0;
    for line in reader.lines() {
      let value: i32 = line.unwrap().parse().unwrap();
      sum += value
    }
    println!("{}", sum);
    Ok(())
}
I'd like to use the iterator methods map and sum in my solution, but I haven't figured out how to do so with the type checker. Suggestions?