about summary refs log tree commit diff
path: root/tvix/eval
diff options
context:
space:
mode:
Diffstat (limited to 'tvix/eval')
-rw-r--r--tvix/eval/src/builtins/mod.rs10
-rw-r--r--tvix/eval/src/errors.rs6
-rw-r--r--tvix/eval/src/nix_search_path.rs11
3 files changed, 14 insertions, 13 deletions
diff --git a/tvix/eval/src/builtins/mod.rs b/tvix/eval/src/builtins/mod.rs
index d9f8567886e3..3048b32fb550 100644
--- a/tvix/eval/src/builtins/mod.rs
+++ b/tvix/eval/src/builtins/mod.rs
@@ -476,7 +476,7 @@ mod pure_builtins {
     async fn builtin_filterSource(_co: GenCo, #[lazy] _e: Value) -> Result<Value, ErrorKind> {
         // TODO: implement for nixpkgs compatibility
         Ok(Value::Catchable(CatchableErrorKind::UnimplementedFeature(
-            "filterSource".to_string(),
+            "filterSource".into(),
         )))
     }
 
@@ -695,7 +695,7 @@ mod pure_builtins {
     ) -> Result<Value, ErrorKind> {
         // FIXME: propagate contexts here.
         Ok(Value::Catchable(CatchableErrorKind::UnimplementedFeature(
-            "hashString".to_string(),
+            "hashString".into(),
         )))
     }
 
@@ -1392,7 +1392,7 @@ mod pure_builtins {
         // TODO(sterni): coerces to string
         // We do not care about the context here explicitly.
         Ok(Value::Catchable(CatchableErrorKind::Throw(
-            message.to_contextful_str()?.to_string(),
+            message.to_contextful_str()?.to_string().into(),
         )))
     }
 
@@ -1531,9 +1531,7 @@ pub fn pure_builtins() -> Vec<(&'static str, Value)> {
     // TODO: implement for nixpkgs compatibility
     result.push((
         "__curPos",
-        Value::Catchable(CatchableErrorKind::UnimplementedFeature(
-            "__curPos".to_string(),
-        )),
+        Value::Catchable(CatchableErrorKind::UnimplementedFeature("__curPos".into())),
     ));
 
     result
diff --git a/tvix/eval/src/errors.rs b/tvix/eval/src/errors.rs
index d5cb6ef34b0d..b59ee675dda4 100644
--- a/tvix/eval/src/errors.rs
+++ b/tvix/eval/src/errors.rs
@@ -40,11 +40,11 @@ use crate::{SourceCode, Value};
 ///
 #[derive(Clone, Debug)]
 pub enum CatchableErrorKind {
-    Throw(String),
+    Throw(Box<str>),
     AssertionFailed,
-    UnimplementedFeature(String),
+    UnimplementedFeature(Box<str>),
     /// Resolving a user-supplied angle brackets path literal failed in some way.
-    NixPathResolution(String),
+    NixPathResolution(Box<str>),
 }
 
 #[derive(Clone, Debug)]
diff --git a/tvix/eval/src/nix_search_path.rs b/tvix/eval/src/nix_search_path.rs
index 2f6d444475ff..566ca122384b 100644
--- a/tvix/eval/src/nix_search_path.rs
+++ b/tvix/eval/src/nix_search_path.rs
@@ -138,10 +138,13 @@ impl NixSearchPath {
                 return Ok(Ok(p));
             }
         }
-        Ok(Err(CatchableErrorKind::NixPathResolution(format!(
-            "path '{}' was not found in the Nix search path",
-            path.display()
-        ))))
+        Ok(Err(CatchableErrorKind::NixPathResolution(
+            format!(
+                "path '{}' was not found in the Nix search path",
+                path.display()
+            )
+            .into_boxed_str(),
+        )))
     }
 }