MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / parse_scalar

Function parse_scalar

atomic-canonical/src/lift.rs:337–350  ·  view source on GitHub ↗
(raw: &str)

Source from the content-addressed store, hash-verified

335}
336
337fn parse_scalar(raw: &str) -> Value {
338 if raw.starts_with('[') && raw.ends_with(']') {
339 let inner = &raw[1..raw.len() - 1];
340 let arr: Vec<Value> = inner
341 .split(',')
342 .map(|s| s.trim().trim_matches(['"', '\'']).to_string())
343 .filter(|s| !s.is_empty())
344 .map(Value::String)
345 .collect();
346 return Value::Array(arr);
347 }
348 let unquoted = raw.trim_matches(['"', '\'']);
349 Value::String(unquoted.to_string())
350}
351
352#[cfg(test)]
353mod tests {

Callers 1

parse_markdownFunction · 0.85

Calls 2

lenMethod · 0.45
is_emptyMethod · 0.45

Tested by

no test coverage detected