summaryrefslogtreecommitdiff
path: root/src/lib.rs
diff options
context:
space:
mode:
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()
+}