(raw: &str)
| 318 | } |
| 319 | |
| 320 | fn parse_scalar(raw: &str) -> Value { |
| 321 | if raw.starts_with('[') && raw.ends_with(']') { |
| 322 | let inner = &raw[1..raw.len() - 1]; |
| 323 | let arr: Vec<Value> = inner |
| 324 | .split(',') |
| 325 | .map(|s| s.trim().trim_matches(['"', '\'']).to_string()) |
| 326 | .filter(|s| !s.is_empty()) |
| 327 | .map(Value::String) |
| 328 | .collect(); |
| 329 | return Value::Array(arr); |
| 330 | } |
| 331 | let unquoted = raw.trim_matches(['"', '\'']); |
| 332 | Value::String(unquoted.to_string()) |
| 333 | } |
| 334 | |
| 335 | #[cfg(test)] |
| 336 | mod tests { |
no test coverage detected