diff options
Diffstat (limited to 'tvix/eval/src/vm.rs')
-rw-r--r-- | tvix/eval/src/vm.rs | 14 |
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, /) |