fix(lib): allow ints function to find negative values (this cost me a good 20 minutes of debugging today)

This commit is contained in:
Ashhhleyyy 2022-12-15 10:48:23 +00:00
parent a67cc28856
commit 7445acf4bb
Signed by: ash
GPG key ID: 83B789081A0878FB

View file

@ -37,7 +37,7 @@ pub fn fetch_input(day: u8) -> Result<String> {
} }
pub fn ints(s: &str) -> Vec<isize> { pub fn ints(s: &str) -> Vec<isize> {
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| { re.find_iter(s).map(|m| {
m.as_str().parse().unwrap() m.as_str().parse().unwrap()