about summary refs log tree commit diff
path: root/tvix/eval/src/value/mod.rs
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2023-11-05T17·31+0300
committerclbot <clbot@tvl.fyi>2023-11-05T20·28+0000
commitb3b1f649d613c97a196528b1210dd5b914995c14 (patch)
tree7ec2a8190c8086325a7962ff74685c88954b91c3 /tvix/eval/src/value/mod.rs
parent67999f0dcf715962b8f56c9bfd8c5c403213cb02 (diff)
chore(tvix): fix trivial clippy lints r/6955
Relates to b/321.

Change-Id: I37284f89b186e469eb432e2bbedb37aa125a6ad4
Reviewed-on: https://cl.tvl.fyi/c/depot/+/9961
Tested-by: BuildkiteCI
Reviewed-by: flokli <flokli@flokli.de>
Autosubmit: tazjin <tazjin@tvl.su>
Diffstat (limited to 'tvix/eval/src/value/mod.rs')
-rw-r--r--tvix/eval/src/value/mod.rs13
1 files changed, 6 insertions, 7 deletions
diff --git a/tvix/eval/src/value/mod.rs b/tvix/eval/src/value/mod.rs
index 9b6e522dd0a6..3a9dcf2c8da1 100644
--- a/tvix/eval/src/value/mod.rs
+++ b/tvix/eval/src/value/mod.rs
@@ -97,7 +97,7 @@ where
     Value: From<V>,
 {
     fn from(v: Result<V, CatchableErrorKind>) -> Value {
-        v.map_or_else(|cek| Value::Catchable(cek), |v| v.into())
+        v.map_or_else(Value::Catchable, |v| v.into())
     }
 }
 
@@ -362,7 +362,7 @@ impl Value {
                 kind,
             }),
 
-            (c @ Value::Catchable(_), _) => return Ok(c),
+            (c @ Value::Catchable(_), _) => Ok(c),
 
             (Value::AttrNotFound, _)
             | (Value::Blueprint(_), _)
@@ -762,11 +762,10 @@ fn total_fmt_float<F: std::fmt::Write>(num: f64, mut f: F) -> std::fmt::Result {
         if !new_s.is_empty() {
             s = &mut new_s
         }
-    }
-    // else, if this is not scientific notation, and there's a
-    // decimal point, make sure we really drop trailing zeroes.
-    // In some cases, lexical_core doesn't.
-    else if s.contains(&b'.') {
+    } else if s.contains(&b'.') {
+        // else, if this is not scientific notation, and there's a
+        // decimal point, make sure we really drop trailing zeroes.
+        // In some cases, lexical_core doesn't.
         for (i, c) in s.iter().enumerate() {
             // at `.``
             if c == &b'.' {