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

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()
}