--- a/crates/jrsonnet-stdlib/src/arrays.rs +++ b/crates/jrsonnet-stdlib/src/arrays.rs @@ -255,24 +255,21 @@ } #[builtin] -pub fn builtin_remove_at( - arr: ArrValue, - index: usize, -) -> Result { +pub fn builtin_remove_at(arr: ArrValue, index: usize) -> Result { let newArrLeft = arr.clone().slice(None, Some(index), None); let newArrRight = arr.slice(Some(index + 1), None, None); - + Ok(ArrValue::extended( newArrLeft.unwrap_or(ArrValue::empty()), - newArrRight.unwrap_or(ArrValue::empty())) - ) + newArrRight.unwrap_or(ArrValue::empty()), + )) } #[builtin] pub fn builtin_remove(arr: ArrValue, elem: Val) -> Result { for (index, item) in arr.iter().enumerate() { if equals(&item?, &elem)? { - return builtin_remove_at(arr.clone(), index) + return builtin_remove_at(arr.clone(), index); } } Ok(arr) --- a/crates/jrsonnet-stdlib/src/sort.rs +++ b/crates/jrsonnet-stdlib/src/sort.rs @@ -209,7 +209,6 @@ } } - fn eval_keyf(val: Val, key_f: &Option) -> Result { if let Some(key_f) = key_f { key_f.evaluate_simple(&(val,), false)