(array: &[f64], encoding: &[(f64, char)])
| 491 | } |
| 492 | |
| 493 | pub fn encode_array(array: &[f64], encoding: &[(f64, char)]) -> String { |
| 494 | let mut s = String::new(); |
| 495 | for v in array { |
| 496 | if let Some(c) = find_nearest(encoding, *v) { |
| 497 | s.push(c); |
| 498 | } |
| 499 | } |
| 500 | s |
| 501 | } |
| 502 | |
| 503 | fn parse_datetime(s: &str) -> Result<NaiveDateTime, chrono::ParseError> { |
| 504 | NaiveDateTime::parse_from_str(s, "%Y-%m-%d %H:%M:%S%.f") |