From 7445acf4bba59189c850bf804c84a6494b06e12f Mon Sep 17 00:00:00 2001 From: Ashhhleyyy Date: Thu, 15 Dec 2022 10:48:23 +0000 Subject: [PATCH] fix(lib): allow ints function to find negative values (this cost me a good 20 minutes of debugging today) --- src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index de4ef17..586c5bc 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -37,7 +37,7 @@ pub fn fetch_input(day: u8) -> Result { } pub fn ints(s: &str) -> Vec { - let re = Regex::new("([1-9][0-9]*|0)").unwrap(); + let re = Regex::new("(-?[1-9][0-9]*|0)").unwrap(); re.find_iter(s).map(|m| { m.as_str().parse().unwrap()