Better split
This commit is contained in:
parent
dfb1b25c48
commit
0ad08975e6
|
@ -8,8 +8,7 @@ fn main() {
|
|||
|
||||
fn nums(input: &str) -> Vec<i32> {
|
||||
input
|
||||
.replace(",", "-")
|
||||
.split("-")
|
||||
.split(&['-', ','])
|
||||
.map(|s| s.parse::<i32>().unwrap())
|
||||
.collect()
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue