fix(lib): allow ints function to find negative values (this cost me a good 20 minutes of debugging today)
This commit is contained in:
parent
a67cc28856
commit
7445acf4bb
1 changed files with 1 additions and 1 deletions
|
@ -37,7 +37,7 @@ pub fn fetch_input(day: u8) -> Result<String> {
|
|||
}
|
||||
|
||||
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| {
|
||||
m.as_str().parse().unwrap()
|
||||
|
|
Loading…
Reference in a new issue