summaryrefslogtreecommitdiff
path: root/2019/src/main.rs
blob: 0c24a73e0472ddbce48231f748a55e01a783974f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
use std::io;
use std::io::prelude::*;

fn main() {
    let stdin = io::stdin();
    let answer = string_length_sum(stdin.lock().lines().map(|l| l.unwrap()));
    dbg!(answer);
}

fn string_length_sum(it: impl Iterator<Item = String>) -> usize {
    it.map(|l| l.len()).sum()
}