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

Function opt_str

atomic-canonical/src/memory.rs:237–243  ·  view source on GitHub ↗
(fm: &Map<String, Value>, key: &str)

Source from the content-addressed store, hash-verified

235}
236
237fn opt_str(fm: &Map<String, Value>, key: &str) -> Option<String> {
238 match fm.get(key) {
239 Some(Value::String(s)) if !s.is_empty() => Some(s.clone()),
240 Some(Value::Number(n)) => Some(n.to_string()),
241 _ => None,
242 }
243}
244
245fn str_array(fm: &Map<String, Value>, key: &str) -> Vec<String> {
246 match fm.get(key) {

Callers 2

lift_memoryFunction · 0.70
require_strFunction · 0.70

Calls 3

getMethod · 0.65
is_emptyMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected