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

Function opt_str

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

Source from the content-addressed store, hash-verified

404}
405
406fn opt_str(fm: &Map<String, Value>, key: &str) -> Option<String> {
407 match fm.get(key) {
408 Some(Value::String(s)) if !s.is_empty() => Some(s.clone()),
409 Some(Value::Number(n)) => Some(n.to_string()),
410 _ => None,
411 }
412}
413
414fn str_array(fm: &Map<String, Value>, key: &str) -> Vec<String> {
415 match fm.get(key) {

Callers 2

lift_intentFunction · 0.70
require_strFunction · 0.70

Calls 3

getMethod · 0.65
is_emptyMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected