about summary refs log tree commit diff
path: root/tvix/eval/src/value/attrs.rs
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2022-08-26T15·35+0300
committertazjin <tazjin@tvl.su>2022-09-03T00·49+0000
commitbc9351f811a9394898d0c9ab4da193e320c27bdd (patch)
treeb878faae89bc5eb46ace89a74ba8883f89cde129 /tvix/eval/src/value/attrs.rs
parentd761d934ed341fe161d5091aecf87c52d3874256 (diff)
refactor(tvix/eval): get rid of Value::Blackhole variant r/4611
This is no longer needed for anything and the extra clone here is not
really more costly than constructing a blackhole value in a different
place.

Change-Id: I5c63085b1b4418b629ea58a42e3bfe9a9b586d76
Reviewed-on: https://cl.tvl.fyi/c/depot/+/6275
Reviewed-by: grfn <grfn@gws.fyi>
Tested-by: BuildkiteCI
Diffstat (limited to 'tvix/eval/src/value/attrs.rs')
-rw-r--r--tvix/eval/src/value/attrs.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/tvix/eval/src/value/attrs.rs b/tvix/eval/src/value/attrs.rs
index 51f741a210a1..74f1bd4481b2 100644
--- a/tvix/eval/src/value/attrs.rs
+++ b/tvix/eval/src/value/attrs.rs
@@ -315,8 +315,8 @@ fn attempt_optimise_kv(slice: &mut [Value]) -> Option<NixAttrs> {
     };
 
     Some(NixAttrs(AttrsRep::KV {
-        name: std::mem::replace(&mut slice[name_idx], Value::Blackhole),
-        value: std::mem::replace(&mut slice[value_idx], Value::Blackhole),
+        name: slice[name_idx].clone(),
+        value: slice[value_idx].clone(),
     }))
 }