diff options
Diffstat (limited to 'tvix/eval/src/value/string.rs')
-rw-r--r-- | tvix/eval/src/value/string.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tvix/eval/src/value/string.rs b/tvix/eval/src/value/string.rs index 72f146765778..1b4f349f1ac5 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> { |