From 0ad08975e6d1c84379172b1829411dcc1ef852a5 Mon Sep 17 00:00:00 2001 From: Daniel Flanagan Date: Sun, 4 Dec 2022 01:26:00 -0600 Subject: [PATCH] Better split --- 2022/rust/src/day4.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/2022/rust/src/day4.rs b/2022/rust/src/day4.rs index 32917ca..019e59d 100644 --- a/2022/rust/src/day4.rs +++ b/2022/rust/src/day4.rs @@ -8,8 +8,7 @@ fn main() { fn nums(input: &str) -> Vec { input - .replace(",", "-") - .split("-") + .split(&['-', ',']) .map(|s| s.parse::().unwrap()) .collect() }