pub fn make_arr(s: &str) -> Vec { s.trim_matches(&['[', ']'][..]) .split(',') .map(|x| { let x = x.trim(); if x == "null" { -1 } else { x.parse::().unwrap() } }) .collect() } pub fn make_matrix(s: &str) -> Vec> { s.trim_matches(&['[', ']'][..]) .split("],[") .map(|row| { row.trim_matches(&['[', ']'][..]) .split(',') .map(|x| x.trim().parse::().unwrap()) .collect() }) .collect() }