feat(tvix/eval): context-aware baseNameOf

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
This commit is contained in:
Ryan Lahfa 2023-12-25 22:06:16 +01:00 committed by clbot
parent e15b6580cc
commit db748741da

View file

@ -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())
}