Better split

This commit is contained in:
Daniel Flanagan 2022-12-04 01:26:00 -06:00
parent dfb1b25c48
commit 0ad08975e6
Signed by: lytedev
GPG Key ID: 5B2020A0F9921EF4
1 changed files with 1 additions and 2 deletions

View File

@ -8,8 +8,7 @@ fn main() {
fn nums(input: &str) -> Vec<i32> {
input
.replace(",", "-")
.split("-")
.split(&['-', ','])
.map(|s| s.parse::<i32>().unwrap())
.collect()
}