MCPcopy Create free account
hub / github.com/MegEngine/MegFlow / as_list

Function as_list

flow-plugins/src/utils/args_parser.rs:36–45  ·  view source on GitHub ↗
(map: &'a Table, key: &str)

Source from the content-addressed store, hash-verified

34}
35
36pub fn as_list<'a>(map: &'a Table, key: &str) -> Vec<&'a Value> {
37 map.get(key)
38 .map(|x| {
39 x.as_array()
40 .unwrap_or_else(|| panic!("Invalid arguments in field {}", key))
41 .iter()
42 .collect()
43 })
44 .unwrap_or_default()
45}

Callers

nothing calls this directly

Calls 1

getMethod · 0.45

Tested by

no test coverage detected