(raw: &str)
| 404 | } |
| 405 | |
| 406 | fn parse_scalar(raw: &str) -> Value { |
| 407 | if raw.starts_with('[') && raw.ends_with(']') { |
| 408 | let inner = &raw[1..raw.len() - 1]; |
| 409 | let arr: Vec<Value> = inner |
| 410 | .split(',') |
| 411 | .map(|s| s.trim().trim_matches(['"', '\'']).to_string()) |
| 412 | .filter(|s| !s.is_empty()) |
| 413 | .map(Value::String) |
| 414 | .collect(); |
| 415 | return Value::Array(arr); |
| 416 | } |
| 417 | let unquoted = raw.trim_matches(['"', '\'']); |
| 418 | Value::String(unquoted.to_string()) |
| 419 | } |
| 420 | |
| 421 | #[cfg(test)] |
| 422 | mod tests { |
no test coverage detected