fix(tvix/eval): fix current clippy warnings

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
This commit is contained in:
Vincent Ambo 2022-12-20 17:22:56 +03:00 committed by clbot
parent 67d508f2ec
commit 71174f6626
17 changed files with 69 additions and 108 deletions

View file

@ -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, /)