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

Function parse_scalar

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

Source from the content-addressed store, hash-verified

391}
392
393fn 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)]
409mod tests {

Callers 1

parse_markdownFunction · 0.85

Calls 2

lenMethod · 0.45
is_emptyMethod · 0.45

Tested by

no test coverage detected