(raw: &str)
| 469 | } |
| 470 | |
| 471 | fn parse_scalar(raw: &str) -> Value { |
| 472 | if raw.starts_with('[') && raw.ends_with(']') { |
| 473 | let inner = &raw[1..raw.len() - 1]; |
| 474 | let arr: Vec<Value> = inner |
| 475 | .split(',') |
| 476 | .map(|s| s.trim().trim_matches(['"', '\'']).to_string()) |
| 477 | .filter(|s| !s.is_empty()) |
| 478 | .map(Value::String) |
| 479 | .collect(); |
| 480 | return Value::Array(arr); |
| 481 | } |
| 482 | let unquoted = raw.trim_matches(['"', '\'']); |
| 483 | Value::String(unquoted.to_string()) |
| 484 | } |
| 485 | |
| 486 | #[cfg(test)] |
| 487 | mod tests { |
no test coverage detected