Summation Over Lines in a File (Advent of Code 2018 Day 1) 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() -&gt; io::Result&lt;()&gt; {
    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?
That's how you use Iterator::sum:

use std::fs::File;
use std::io::{self, prelude::*, BufReader};

fn main() -&gt; io::Result&lt;()&gt; {
    let file = File::open("day01.txt")?;
    let reader = BufReader::new(file);
    let sum: i32 = reader
        .lines()
        .map(|line| line.unwrap().parse::&lt;i32&gt;().unwrap())
        .sum();

    println!("{}", sum);

    Ok(())
}


You must first say to what type the line must be parsed: parse::&lt;i32&gt;() and then, you must give the sum a type because the output of the Add trait is not the same as self and other.