From db748741da960a0dd8d1c0a014706b72f784fbc6 Mon Sep 17 00:00:00 2001 From: Ryan Lahfa Date: Mon, 25 Dec 2023 22:06:16 +0100 Subject: feat(tvix/eval): context-aware `baseNameOf` Change-Id: I9f0a8143070805b85276f721bdfbdf7ede2cf615 Reviewed-on: https://cl.tvl.fyi/c/depot/+/10421 Reviewed-by: tazjin Autosubmit: raitobezarius Tested-by: BuildkiteCI --- tvix/eval/src/builtins/mod.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'tvix/eval/src') 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()) } -- cgit 1.4.1