about summary refs log tree commit diff
path: root/tvix/eval/src
diff options
context:
space:
mode:
Diffstat (limited to 'tvix/eval/src')
-rw-r--r--tvix/eval/src/builtins/impure.rs5
-rw-r--r--tvix/eval/src/builtins/mod.rs14
-rw-r--r--tvix/eval/src/tests/mod.rs6
3 files changed, 4 insertions, 21 deletions
diff --git a/tvix/eval/src/builtins/impure.rs b/tvix/eval/src/builtins/impure.rs
index 0cebd5f6ab58..3eaebf101e3d 100644
--- a/tvix/eval/src/builtins/impure.rs
+++ b/tvix/eval/src/builtins/impure.rs
@@ -65,10 +65,7 @@ mod impure_builtins {
 /// Return all impure builtins, that is all builtins which may perform I/O
 /// outside of the VM and so cannot be used in all contexts (e.g. WASM).
 pub fn impure_builtins() -> Vec<(&'static str, Value)> {
-    let mut result = impure_builtins::builtins()
-        .into_iter()
-        .map(super::builtin_tuple)
-        .collect::<Vec<_>>();
+    let mut result = impure_builtins::builtins();
 
     result.push((
         "storeDir",
diff --git a/tvix/eval/src/builtins/mod.rs b/tvix/eval/src/builtins/mod.rs
index 7614353f5bbb..b1ea408a8ca4 100644
--- a/tvix/eval/src/builtins/mod.rs
+++ b/tvix/eval/src/builtins/mod.rs
@@ -14,7 +14,7 @@ use crate::arithmetic_op;
 use crate::warnings::WarningKind;
 use crate::{
     errors::{ErrorKind, EvalResult},
-    value::{Builtin, CoercionKind, NixAttrs, NixList, NixString, Value},
+    value::{CoercionKind, NixAttrs, NixList, NixString, Value},
     vm::VM,
 };
 
@@ -968,17 +968,10 @@ mod pure_builtins {
     }
 }
 
-pub(crate) fn builtin_tuple(builtin: Builtin) -> (&'static str, Value) {
-    (builtin.name(), Value::Builtin(builtin))
-}
-
 /// The set of standard pure builtins in Nix, mostly concerned with
 /// data structure manipulation (string, attrs, list, etc. functions).
 pub fn pure_builtins() -> Vec<(&'static str, Value)> {
-    let mut result = pure_builtins::builtins()
-        .into_iter()
-        .map(builtin_tuple)
-        .collect::<Vec<_>>();
+    let mut result = pure_builtins::builtins();
 
     // Pure-value builtins
     result.push(("nixVersion", Value::String("2.3-compat-tvix-0.1".into())));
@@ -1038,7 +1031,4 @@ mod placeholder_builtins {
 
 pub fn placeholders() -> Vec<(&'static str, Value)> {
     placeholder_builtins::builtins()
-        .into_iter()
-        .map(builtin_tuple)
-        .collect()
 }
diff --git a/tvix/eval/src/tests/mod.rs b/tvix/eval/src/tests/mod.rs
index b8d9dfc6e086..98c93ba27084 100644
--- a/tvix/eval/src/tests/mod.rs
+++ b/tvix/eval/src/tests/mod.rs
@@ -48,11 +48,7 @@ fn eval_test(code_path: &str, expect_success: bool) {
     }
 
     let mut eval = crate::Evaluation::new_impure(&code, Some(code_path.into()));
-    eval.builtins.extend(
-        mock_builtins::builtins()
-            .into_iter()
-            .map(crate::builtins::builtin_tuple),
-    );
+    eval.builtins.extend(mock_builtins::builtins());
 
     let result = eval.evaluate();