about summary refs log tree commit diff
path: root/tvix/eval/src/vm.rs
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2022-12-20T14·22+0300
committerclbot <clbot@tvl.fyi>2022-12-25T18·25+0000
commit71174f6626cbf100a8428ddc334681e4edfb45e6 (patch)
tree1e803137d755001700f0e900aa5173bbf43fdf3f /tvix/eval/src/vm.rs
parent67d508f2ece710714ce8abf6f7deba1fd2440487 (diff)
fix(tvix/eval): fix current clippy warnings r/5486
It's been a while since the last time, so quite a lot of stuff has
accumulated here.

Change-Id: I0762827c197b30a917ff470fd8ae8f220f6ba247
Reviewed-on: https://cl.tvl.fyi/c/depot/+/7597
Reviewed-by: grfn <grfn@gws.fyi>
Autosubmit: tazjin <tazjin@tvl.su>
Tested-by: BuildkiteCI
Diffstat (limited to 'tvix/eval/src/vm.rs')
-rw-r--r--tvix/eval/src/vm.rs14
1 files changed, 6 insertions, 8 deletions
diff --git a/tvix/eval/src/vm.rs b/tvix/eval/src/vm.rs
index 6c0d1157ec8d..f1dc99439638 100644
--- a/tvix/eval/src/vm.rs
+++ b/tvix/eval/src/vm.rs
@@ -275,8 +275,8 @@ impl<'o> VM<'o> {
     }
 
     /// Access the I/O handle used for filesystem access in this VM.
-    pub(crate) fn io(&self) -> &Box<dyn EvalIO> {
-        &self.io_handle
+    pub(crate) fn io(&self) -> &dyn EvalIO {
+        &*self.io_handle
     }
 
     /// Construct an error from the given ErrorKind and the source
@@ -385,7 +385,7 @@ impl<'o> VM<'o> {
                 // that of the tail-called closure.
                 let mut frame = self.frame_mut();
                 frame.lambda = lambda;
-                frame.upvalues = closure.upvalues().clone();
+                frame.upvalues = closure.upvalues();
                 frame.ip = CodeIdx(0); // reset instruction pointer to beginning
                 Ok(())
             }
@@ -584,10 +584,8 @@ impl<'o> VM<'o> {
                 (Value::List(_), _) => break false,
 
                 (Value::Attrs(a1), Value::Attrs(a2)) => {
-                    if allow_pointer_equality_on_functions_and_thunks {
-                        if Rc::ptr_eq(&a1, &a2) {
-                            continue;
-                        }
+                    if allow_pointer_equality_on_functions_and_thunks && Rc::ptr_eq(&a1, &a2) {
+                        continue;
                     }
                     allow_pointer_equality_on_functions_and_thunks = true;
                     match (a1.select("type"), a2.select("type")) {
@@ -708,7 +706,7 @@ impl<'o> VM<'o> {
                 match b {
                     Value::Integer(0) => return Err(self.error(ErrorKind::DivisionByZero)),
                     Value::Float(b) => {
-                        if *b == (0.0 as f64) {
+                        if *b == 0.0_f64 {
                             return Err(self.error(ErrorKind::DivisionByZero));
                         }
                         arithmetic_op!(self, /)