about summary refs log tree commit diff
path: root/tvix/eval/src/value
diff options
context:
space:
mode:
authorsterni <sternenseemann@systemli.org>2022-09-16T21·13+0200
committersterni <sternenseemann@systemli.org>2022-09-16T22·58+0000
commit53fbc75df9ee4aa06eccc9f12bfe9cab8eab5755 (patch)
tree619db2b4d61316ba965ab460796312d1ce933560 /tvix/eval/src/value
parentdb093ad10c0228b017486cc59b7edd691b1b1b73 (diff)
refactor(tvix/eval): fix current clippy lints r/4881
Change-Id: I88482453a62955515a0dcc0b243351b2bbac5236
Reviewed-on: https://cl.tvl.fyi/c/depot/+/6618
Reviewed-by: grfn <grfn@gws.fyi>
Tested-by: BuildkiteCI
Diffstat (limited to 'tvix/eval/src/value')
-rw-r--r--tvix/eval/src/value/mod.rs13
1 files changed, 5 insertions, 8 deletions
diff --git a/tvix/eval/src/value/mod.rs b/tvix/eval/src/value/mod.rs
index dc6202dab547..c4e8221e158d 100644
--- a/tvix/eval/src/value/mod.rs
+++ b/tvix/eval/src/value/mod.rs
@@ -126,10 +126,7 @@ impl Value {
             // `__toString` is preferred.
             (Value::Attrs(attrs), _) => {
                 match (attrs.select("__toString"), attrs.select("outPath")) {
-                    (None, None) => Err(ErrorKind::NotCoercibleToString {
-                        from: "set",
-                        kind: kind,
-                    }),
+                    (None, None) => Err(ErrorKind::NotCoercibleToString { from: "set", kind }),
 
                     (Some(f), _) => {
                         // use a closure here to deal with the thunk borrow we need to do below
@@ -165,7 +162,7 @@ impl Value {
                             let guard = t.value();
                             call_to_string(&*guard, vm)
                         } else {
-                            call_to_string(&f, vm)
+                            call_to_string(f, vm)
                         }
                     }
 
@@ -199,7 +196,7 @@ impl Value {
                         Ok(a.concat(&" ".into()).concat(s))
                     })
                     // None from reduce indicates empty iterator
-                    .unwrap_or(Ok("".into()))
+                    .unwrap_or_else(|| Ok("".into()))
             }
 
             (Value::Closure(_), _)
@@ -210,7 +207,7 @@ impl Value {
             | (Value::Float(_), _)
             | (Value::List(_), _) => Err(ErrorKind::NotCoercibleToString {
                 from: self.type_of(),
-                kind: kind,
+                kind,
             }),
 
             (Value::AttrPath(_), _)
@@ -314,7 +311,7 @@ impl PartialEq for Value {
             // compared instead. The compiler should ensure that
             // thunks under comparison have been forced, otherwise it
             // is a bug.
-            (Value::Thunk(lhs), Value::Thunk(rhs)) => &*lhs.value() == &*rhs.value(),
+            (Value::Thunk(lhs), Value::Thunk(rhs)) => *lhs.value() == *rhs.value(),
             (Value::Thunk(lhs), rhs) => &*lhs.value() == rhs,
             (lhs, Value::Thunk(rhs)) => lhs == &*rhs.value(),