(raw: &str)
| 391 | } |
| 392 | |
| 393 | fn parse_scalar(raw: &str) -> Value { |
| 394 | if raw.starts_with('[') && raw.ends_with(']') { |
| 395 | let inner = &raw[1..raw.len() - 1]; |
| 396 | let arr: Vec<Value> = inner |
| 397 | .split(',') |
| 398 | .map(|s| s.trim().trim_matches(['"', '\'']).to_string()) |
| 399 | .filter(|s| !s.is_empty()) |
| 400 | .map(Value::String) |
| 401 | .collect(); |
| 402 | return Value::Array(arr); |
| 403 | } |
| 404 | let unquoted = raw.trim_matches(['"', '\'']); |
| 405 | Value::String(unquoted.to_string()) |
| 406 | } |
| 407 | |
| 408 | #[cfg(test)] |
| 409 | mod tests { |
no test coverage detected