--- a/crates/jrsonnet-stdlib/src/arrays.rs +++ b/crates/jrsonnet-stdlib/src/arrays.rs @@ -260,11 +260,12 @@ index: usize, ) -> Result { let newArrLeft = arr.clone().slice(None, Some(index), None); - let newArrRight = arr.clone().slice(Some(index + 1), None, None); - return Ok(ArrValue::extended( + let newArrRight = arr.slice(Some(index + 1), None, None); + + Ok(ArrValue::extended( newArrLeft.unwrap_or(ArrValue::empty()), newArrRight.unwrap_or(ArrValue::empty())) - ); + ) } #[builtin]