about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--tvix/eval/src/vm/mod.rs20
1 files changed, 8 insertions, 12 deletions
diff --git a/tvix/eval/src/vm/mod.rs b/tvix/eval/src/vm/mod.rs
index 5b9aecb8d440..fd71dbacf480 100644
--- a/tvix/eval/src/vm/mod.rs
+++ b/tvix/eval/src/vm/mod.rs
@@ -1214,18 +1214,14 @@ async fn add_values(co: GenCo, a: Value, b: Value) -> Result<Value, ErrorKind> {
             }
         }
         (Value::String(s1), Value::String(s2)) => Value::String(s1.concat(&s2)),
-        (Value::String(s1), v) => Value::String(
-            match generators::request_string_coerce(&co, v, CoercionKind::Weak).await {
-                Ok(s2) => s1.concat(&s2),
-                Err(c) => return Ok(Value::Catchable(c)),
-            },
-        ),
-        (v, Value::String(s2)) => Value::String(
-            match generators::request_string_coerce(&co, v, CoercionKind::Weak).await {
-                Ok(s1) => s1.concat(&s2),
-                Err(c) => return Ok(Value::Catchable(c)),
-            },
-        ),
+        (Value::String(s1), v) => generators::request_string_coerce(&co, v, CoercionKind::Weak)
+            .await
+            .map(|s2| Value::String(s1.concat(&s2)))
+            .into(),
+        (v, Value::String(s2)) => generators::request_string_coerce(&co, v, CoercionKind::Weak)
+            .await
+            .map(|s1| Value::String(s1.concat(&s2)))
+            .into(),
         (a, b) => arithmetic_op!(&a, &b, +)?,
     };