MCPcopy Create free account
hub / github.com/AmrDeveloper/GQL / array_remove

Function array_remove

crates/gitql-std/src/array/mod.rs:190–200  ·  view source on GitHub ↗
(inputs: &[Box<dyn Value>])

Source from the content-addressed store, hash-verified

188}
189
190pub fn array_remove(inputs: &[Box<dyn Value>]) -> Box<dyn Value> {
191 let array = inputs[0].as_array().unwrap();
192 let element_to_remove = &inputs[1];
193 let array_after_remove = array
194 .into_iter()
195 .filter(|element| !element_to_remove.equals(element))
196 .collect();
197
198 let element_type = inputs[0].data_type().clone();
199 Box::new(ArrayValue::new(array_after_remove, element_type))
200}
201
202pub fn array_cat(inputs: &[Box<dyn Value>]) -> Box<dyn Value> {
203 let mut first = inputs[0].as_array().unwrap();

Callers

nothing calls this directly

Calls 3

as_arrayMethod · 0.80
equalsMethod · 0.45
data_typeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…