From e31f8f735f72fa1d71f4a030ff778ebe640e9fb1 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sat, 24 Sep 2022 16:38:16 +0300 Subject: chore(tvix/eval): fix all current clippy lints Change-Id: I28d6af8cb408f8427a75d30b9120aaa809a1ea40 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6784 Reviewed-by: sterni Tested-by: BuildkiteCI --- tvix/eval/src/builtins/mod.rs | 4 ++-- tvix/eval/src/builtins/versions.rs | 2 +- tvix/eval/src/compiler/mod.rs | 4 ++-- tvix/eval/src/errors.rs | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tvix/eval/src/builtins/mod.rs b/tvix/eval/src/builtins/mod.rs index 80c1fac2c0e2..45630819e124 100644 --- a/tvix/eval/src/builtins/mod.rs +++ b/tvix/eval/src/builtins/mod.rs @@ -59,7 +59,7 @@ fn pure_builtins() -> Vec { |args, vm| arithmetic_op!(&*args[0].force(vm)?, &*args[1].force(vm)?, +), ), Builtin::new("abort", &[true], |args, _| { - return Err(ErrorKind::Abort(args[0].to_str()?.to_string())); + Err(ErrorKind::Abort(args[0].to_str()?.to_string())) }), Builtin::new("attrNames", &[true], |args, _| { let xs = args[0].to_attrs()?; @@ -313,7 +313,7 @@ fn pure_builtins() -> Vec { } }), Builtin::new("throw", &[true], |args, _| { - return Err(ErrorKind::Throw(args[0].to_str()?.to_string())); + Err(ErrorKind::Throw(args[0].to_str()?.to_string())) }), // coerce_to_string forces for us Builtin::new("toString", &[false], |args, vm| { diff --git a/tvix/eval/src/builtins/versions.rs b/tvix/eval/src/builtins/versions.rs index 9da7b52ab15c..79fb82b868fb 100644 --- a/tvix/eval/src/builtins/versions.rs +++ b/tvix/eval/src/builtins/versions.rs @@ -18,7 +18,7 @@ impl PartialOrd for VersionPart<'_> { } impl Ord for VersionPart<'_> { - fn cmp(self: &Self, other: &Self) -> Ordering { + fn cmp(&self, other: &Self) -> Ordering { match (self, other) { (VersionPart::Number(s1), VersionPart::Number(s2)) => { // Note: C++ Nix uses `int`, but probably doesn't make a difference diff --git a/tvix/eval/src/compiler/mod.rs b/tvix/eval/src/compiler/mod.rs index dab91a7f56d3..bae58434b3a1 100644 --- a/tvix/eval/src/compiler/mod.rs +++ b/tvix/eval/src/compiler/mod.rs @@ -553,7 +553,7 @@ impl Compiler<'_> { } // Push the set onto the stack - self.compile(slot, set.clone()); + self.compile(slot, set); // Compile each key fragment and emit access instructions. // @@ -604,7 +604,7 @@ impl Compiler<'_> { path: ast::Attrpath, default: ast::Expr, ) { - self.compile(slot, set.clone()); + self.compile(slot, set); let mut jumps = vec![]; for fragment in path.attrs() { diff --git a/tvix/eval/src/errors.rs b/tvix/eval/src/errors.rs index 7ec43abb85a9..822ebdbc8cb4 100644 --- a/tvix/eval/src/errors.rs +++ b/tvix/eval/src/errors.rs @@ -162,7 +162,7 @@ impl Error { format!("list index '{}' is out of bounds", index) } - ErrorKind::TailEmptyList => format!("'tail' called on an empty list"), + ErrorKind::TailEmptyList => "'tail' called on an empty list".to_string(), ErrorKind::TypeError { expected, actual } => format!( "expected value of type '{}', but found a '{}'", -- cgit 1.4.1