about summary refs log tree commit diff
path: root/tvix/eval/src/value
diff options
context:
space:
mode:
authorAaqa Ishtyaq <aaqaishtyaq@gmail.com>2023-02-16T08·59+0530
committerclbot <clbot@tvl.fyi>2023-02-16T22·42+0000
commitfaffb2a4cb7482d8c7437809b113066244251084 (patch)
tree8878ae952d6ab5cd94b63aaf6b5de53ea1e748db /tvix/eval/src/value
parentbfe6cace5ed1565794801ef3d3bfffaffb360330 (diff)
refactor(tvix/eval): remove redundant clone r/5857
This CL removes redundant clone from value which is
going to be dropped without further use.

Change-Id: Ibd2a724853c5cfbf8ca40bf0b3adf0fab89b9be5
Signed-off-by: Aaqa Ishtyaq <aaqaishtyaq@gmail.com>
Reviewed-on: https://cl.tvl.fyi/c/depot/+/8125
Reviewed-by: tazjin <tazjin@tvl.su>
Tested-by: BuildkiteCI
Diffstat (limited to 'tvix/eval/src/value')
-rw-r--r--tvix/eval/src/value/thunk.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/tvix/eval/src/value/thunk.rs b/tvix/eval/src/value/thunk.rs
index c9479fde370f..e30d58e72849 100644
--- a/tvix/eval/src/value/thunk.rs
+++ b/tvix/eval/src/value/thunk.rs
@@ -189,7 +189,7 @@ impl Thunk {
             // returning another thunk.
             ThunkRepr::Native(native) => {
                 let value = native.0(vm)?;
-                self.0.replace(ThunkRepr::Evaluated(value.clone()));
+                self.0.replace(ThunkRepr::Evaluated(value));
                 let self_clone = self.clone();
 
                 return Ok(Trampoline {
@@ -268,7 +268,7 @@ impl Thunk {
                     ThunkRepr::Native(native) => {
                         let value = native.0(vm)?;
                         self.0.replace(ThunkRepr::Evaluated(value.clone()));
-                        inner.0.replace(ThunkRepr::Evaluated(value.clone()));
+                        inner.0.replace(ThunkRepr::Evaluated(value));
                         let self_clone = self.clone();
 
                         return Ok(Trampoline {
@@ -308,7 +308,7 @@ impl Thunk {
                                 debug_assert!(matches!(self_blackhole, ThunkRepr::Blackhole));
 
                                 let inner_blackhole =
-                                    inner_clone.0.replace(ThunkRepr::Evaluated(result.clone()));
+                                    inner_clone.0.replace(ThunkRepr::Evaluated(result));
                                 debug_assert!(matches!(inner_blackhole, ThunkRepr::Blackhole));
 
                                 Thunk::force_trampoline(vm, Value::Thunk(self_clone))
@@ -330,7 +330,7 @@ impl Thunk {
                     // out of here and memoize the innermost thunk.
                     ThunkRepr::Evaluated(v) => {
                         self.0.replace(ThunkRepr::Evaluated(v.clone()));
-                        inner.0.replace(ThunkRepr::Evaluated(v.clone()));
+                        inner.0.replace(ThunkRepr::Evaluated(v));
                         let self_clone = self.clone();
 
                         return Ok(Trampoline {