feat(tvix/eval): Implement builtins.concatStringsSep

Change-Id: I6e46bcdbf3b5258b60edb017709fee577eb8ec74
Reviewed-on: https://cl.tvl.fyi/c/depot/+/6907
Reviewed-by: tazjin <tazjin@tvl.su>
Tested-by: BuildkiteCI
This commit is contained in:
Griffin Smith 2022-10-09 13:09:11 -04:00 committed by grfn
parent 41ddc37725
commit 66a35de3b6
5 changed files with 46 additions and 0 deletions

View file

@ -377,6 +377,12 @@ impl From<&str> for Value {
}
}
impl From<String> for Value {
fn from(val: String) -> Self {
Self::String(val.into())
}
}
fn type_error(expected: &'static str, actual: &Value) -> ErrorKind {
ErrorKind::TypeError {
expected,

View file

@ -2,6 +2,7 @@
//! backing implementations.
use smol_str::SmolStr;
use std::hash::Hash;
use std::ops::Deref;
use std::{borrow::Cow, fmt::Display, str::Chars};
#[derive(Clone, Debug)]
@ -178,6 +179,20 @@ impl Display for NixString {
}
}
impl AsRef<str> for NixString {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl Deref for NixString {
type Target = str;
fn deref(&self) -> &Self::Target {
self.as_str()
}
}
#[cfg(test)]
mod tests {
use super::*;