about summary refs log tree commit diff
path: root/tvix/eval/src/builtins
diff options
context:
space:
mode:
authorRyan Lahfa <tvl@lahfa.xyz>2023-12-25T21·06+0100
committerclbot <clbot@tvl.fyi>2024-01-03T16·54+0000
commitdb748741da960a0dd8d1c0a014706b72f784fbc6 (patch)
tree211993faa7d6d82b454f459b39aae4f1133def97 /tvix/eval/src/builtins
parente15b6580cce173c7a3246d421c4d16285bd892e9 (diff)
feat(tvix/eval): context-aware `baseNameOf` r/7319
Change-Id: I9f0a8143070805b85276f721bdfbdf7ede2cf615
Reviewed-on: https://cl.tvl.fyi/c/depot/+/10421
Reviewed-by: tazjin <tazjin@tvl.su>
Autosubmit: raitobezarius <tvl@lahfa.xyz>
Tested-by: BuildkiteCI
Diffstat (limited to 'tvix/eval/src/builtins')
-rw-r--r--tvix/eval/src/builtins/mod.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/tvix/eval/src/builtins/mod.rs b/tvix/eval/src/builtins/mod.rs
index a79199339c13..6723b8d626ae 100644
--- a/tvix/eval/src/builtins/mod.rs
+++ b/tvix/eval/src/builtins/mod.rs
@@ -161,9 +161,12 @@ mod pure_builtins {
                     span,
                 )
                 .await?
-                .to_str()?,
+                .to_contextful_str()?,
         };
-        let result: String = s.rsplit_once('/').map(|(_, x)| x).unwrap_or(&s).into();
+        let result: NixString = NixString::new_inherit_context_from(
+            &s,
+            s.rsplit_once('/').map(|(_, x)| x).unwrap_or(&s),
+        );
         Ok(result.into())
     }