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