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

Function parse_scalar

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

Source from the content-addressed store, hash-verified

318}
319
320fn 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)]
336mod tests {

Callers 1

parse_markdownFunction · 0.85

Calls 2

lenMethod · 0.45
is_emptyMethod · 0.45

Tested by

no test coverage detected