about summary refs log tree commit diff
path: root/tvix/eval/src/value/string.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tvix/eval/src/value/string.rs')
-rw-r--r--tvix/eval/src/value/string.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/tvix/eval/src/value/string.rs b/tvix/eval/src/value/string.rs
index 72f1467657..1b4f349f1a 100644
--- a/tvix/eval/src/value/string.rs
+++ b/tvix/eval/src/value/string.rs
@@ -63,6 +63,12 @@ impl NixString {
             Cow::Owned(s) => Cow::Owned(format!("\"{}\"", s)),
         }
     }
+
+    pub fn concat(&self, other: &Self) -> Self {
+        let mut s = self.as_str().to_owned();
+        s.push_str(other.as_str());
+        NixString::Heap(s)
+    }
 }
 
 fn nix_escape_char(ch: char) -> Option<&'static str> {