about summary refs log tree commit diff
path: root/tvix/eval/src/builtins/mod.rs
diff options
context:
space:
mode:
authorGriffin Smith <root@gws.fyi>2022-10-08T17·33-0400
committergrfn <grfn@gws.fyi>2022-10-08T19·02+0000
commit278bccc1ea3542610012177171234ad1c3c44dcf (patch)
tree029d2723a6dd1e788cc5c165e015df255c033bed /tvix/eval/src/builtins/mod.rs
parentf6bcd11cad1e370deb0580ae1a7f4d050cd75bab (diff)
refactor(tvix/eval): Encapsulate Value::Attrs construction r/5067
Factor out the construction of Value::Attrs (including the Rc) into a
new `attrs` constructor function, to abstract away the presence of the
Rc itself.

Change-Id: I42fd4c3841e1db368db999ddd651277ff995f025
Reviewed-on: https://cl.tvl.fyi/c/depot/+/6892
Autosubmit: grfn <grfn@gws.fyi>
Reviewed-by: sterni <sternenseemann@systemli.org>
Reviewed-by: tazjin <tazjin@tvl.su>
Tested-by: BuildkiteCI
Diffstat (limited to 'tvix/eval/src/builtins/mod.rs')
-rw-r--r--tvix/eval/src/builtins/mod.rs3
1 files changed, 1 insertions, 2 deletions
diff --git a/tvix/eval/src/builtins/mod.rs b/tvix/eval/src/builtins/mod.rs
index b0aab352d23b..eeb784ce4468 100644
--- a/tvix/eval/src/builtins/mod.rs
+++ b/tvix/eval/src/builtins/mod.rs
@@ -6,7 +6,6 @@
 use std::cmp;
 use std::collections::{BTreeMap, HashMap};
 use std::path::PathBuf;
-use std::rc::Rc;
 
 use crate::{
     errors::ErrorKind,
@@ -439,7 +438,7 @@ pub fn global_builtins() -> HashMap<&'static str, Value> {
         }
     }
 
-    globals.insert("builtins", Value::Attrs(Rc::new(builtins)));
+    globals.insert("builtins", Value::attrs(builtins));
 
     globals
 }