about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--tvix/eval/src/value/list.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/tvix/eval/src/value/list.rs b/tvix/eval/src/value/list.rs
index 66f7eb8108..8ea3db7aec 100644
--- a/tvix/eval/src/value/list.rs
+++ b/tvix/eval/src/value/list.rs
@@ -100,6 +100,11 @@ impl NixList {
 
         Ok(true)
     }
+
+    /// force each element of the list (shallowly), making it safe to call .get().value()
+    pub fn force_elements(&self, vm: &mut VM) -> Result<(), ErrorKind> {
+        self.iter().try_for_each(|v| v.force(vm).map(|_| ()))
+    }
 }
 
 impl IntoIterator for NixList {