diff options
author | Justin Worthe <justin@worthe-it.co.za> | 2017-12-02 07:26:08 +0200 |
---|---|---|
committer | Justin Worthe <justin@worthe-it.co.za> | 2017-12-02 07:26:08 +0200 |
commit | 33db46ef6dcdddeb8e9c64ca6f18a1cedfe9de36 (patch) | |
tree | e8c83fd3e00ccdf30e8c01efe6abb5032c0b03b0 /src/lib.rs | |
parent | 5e5abff58c998448908acf71937915d72314c9ea (diff) |
Day 2
Diffstat (limited to 'src/lib.rs')
-rw-r--r-- | src/lib.rs | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -59,3 +59,9 @@ impl AdventArgs { .collect() } } + +pub fn parse_space_separated_ints(line: &String) -> Result<Vec<i32>, std::num::ParseIntError> { + line.split_whitespace() + .map(|x| x.parse::<i32>()) + .collect() +} |