MCPcopy Create free account
hub / github.com/NativeScript/SimDeck / non_empty_string_field

Function non_empty_string_field

packages/server/src/logs.rs:233–239  ·  view source on GitHub ↗
(payload: &Value, key: &str)

Source from the content-addressed store, hash-verified

231}
232
233fn non_empty_string_field(payload: &Value, key: &str) -> Option<String> {
234 payload
235 .get(key)
236 .and_then(Value::as_str)
237 .filter(|value| !value.is_empty())
238 .map(ToOwned::to_owned)
239}
240
241#[cfg(test)]
242mod tests {

Callers 2

parse_log_entryFunction · 0.85
string_fieldFunction · 0.85

Calls 2

is_emptyMethod · 0.80
getMethod · 0.65

Tested by

no test coverage detected