summaryrefslogtreecommitdiff
path: root/src/lib.rs
diff options
context:
space:
mode:
authorJustin Worthe <justin@worthe-it.co.za>2017-12-02 07:26:08 +0200
committerJustin Worthe <justin@worthe-it.co.za>2017-12-02 07:26:08 +0200
commit33db46ef6dcdddeb8e9c64ca6f18a1cedfe9de36 (patch)
treee8c83fd3e00ccdf30e8c01efe6abb5032c0b03b0 /src/lib.rs
parent5e5abff58c998448908acf71937915d72314c9ea (diff)
Day 2
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/lib.rs b/src/lib.rs
index c5a0f16..5d3721f 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -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()
+}