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

Function opt_str

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

Source from the content-addressed store, hash-verified

253}
254
255fn opt_str(fm: &Map<String, Value>, key: &str) -> Option<String> {
256 match fm.get(key) {
257 Some(Value::String(s)) if !s.is_empty() => Some(s.clone()),
258 Some(Value::Number(n)) => Some(n.to_string()),
259 _ => None,
260 }
261}
262
263fn str_array(fm: &Map<String, Value>, key: &str) -> Vec<String> {
264 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