diff options
author | Vincent Ambo <mail@tazj.in> | 2022-12-29T14·34+0300 |
---|---|---|
committer | tazjin <tazjin@tvl.su> | 2022-12-29T17·44+0000 |
commit | 86361f0f4a754370b42ae3568ece4bc43850f36b (patch) | |
tree | cfbef4d124f2e21b760a9dacaaa03b454d322e27 /tvix/eval/src/builtins | |
parent | 91465dc78ec7b4a8c9b651657bb8ad5f25c556a7 (diff) |
refactor(tvix/eval): remove extra Rc<..> around Value::Attrs r/5542
The `im::OrdMap` is already small and cheap to copy while sharing memory, so this is not required anymore. Only the `KV` variant may have slightly larger content, but in practice this doesn't seem to make a difference when comparing the two variants and this one is less complicated. Change-Id: I64a563b209a2444125653777551373cb2989ca7d Reviewed-on: https://cl.tvl.fyi/c/depot/+/7677 Reviewed-by: sterni <sternenseemann@systemli.org> Tested-by: BuildkiteCI
Diffstat (limited to 'tvix/eval/src/builtins')
-rw-r--r-- | tvix/eval/src/builtins/mod.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tvix/eval/src/builtins/mod.rs b/tvix/eval/src/builtins/mod.rs index 9f03cd85b8e4..2e043a1b104f 100644 --- a/tvix/eval/src/builtins/mod.rs +++ b/tvix/eval/src/builtins/mod.rs @@ -21,7 +21,7 @@ use crate::{ vm::VM, }; -use crate::{arithmetic_op, unwrap_or_clone_rc}; +use crate::arithmetic_op; use self::versions::{VersionPart, VersionPartsIter}; @@ -1022,8 +1022,8 @@ fn placeholders() -> Vec<Builtin> { // values on the fields that a real derivation would contain. // // Crucially this means we do not yet *validate* the values either. - let attrs = unwrap_or_clone_rc(args[0].to_attrs()?); - let attrs = attrs.update(NixAttrs::from_iter( + let input = args[0].to_attrs()?; + let attrs = input.update(NixAttrs::from_iter( [ ( "outPath", @@ -1038,7 +1038,7 @@ fn placeholders() -> Vec<Builtin> { .into_iter(), )); - Ok(Value::Attrs(Rc::new(attrs))) + Ok(Value::Attrs(Box::new(attrs))) }, ), ] |