feat(tvix/eval): implement string concatenation
Change-Id: If61066e59232b2bad42b5cb5f0f2d9b9c416be8b Reviewed-on: https://cl.tvl.fyi/c/depot/+/6137 Tested-by: BuildkiteCI Reviewed-by: sterni <sternenseemann@systemli.org>
This commit is contained in:
parent
322ce36cea
commit
fb3d024d75
6 changed files with 23 additions and 1 deletions
|
|
@ -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> {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue