diff options
author | Ryan Lahfa <tvl@lahfa.xyz> | 2023-12-25T23·38+0100 |
---|---|---|
committer | clbot <clbot@tvl.fyi> | 2024-01-03T16·45+0000 |
commit | 743c3620491dba67ebeaf439a4f0073f97d5e0af (patch) | |
tree | 5db1c6bf1099b4a8815d4c6a19ff2397116e7edf /tvix/eval/src/value/string.rs | |
parent | 802f374a90d8202785a34648c39aa6320ac171d9 (diff) |
feat(tvix/eval): context-aware `coerce_to_string` r/7317
I am still undecided whether we need a CoercionKind to control the coerced context, here's a simple attempt. Change-Id: Ibe59d09ef26c519a6acfdfe392014446646dd6d8 Reviewed-on: https://cl.tvl.fyi/c/depot/+/10426 Reviewed-by: tazjin <tazjin@tvl.su> Tested-by: BuildkiteCI Autosubmit: raitobezarius <tvl@lahfa.xyz>
Diffstat (limited to 'tvix/eval/src/value/string.rs')
-rw-r--r-- | tvix/eval/src/value/string.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tvix/eval/src/value/string.rs b/tvix/eval/src/value/string.rs index 56f9a3f8606a..aa82ed36eb40 100644 --- a/tvix/eval/src/value/string.rs +++ b/tvix/eval/src/value/string.rs @@ -322,6 +322,10 @@ impl NixString { Self::new_context_from(context, &s.into_boxed_str()) } + pub(crate) fn context_mut(&mut self) -> Option<&mut NixContext> { + return self.1.as_mut(); + } + pub fn iter_plain(&self) -> impl Iterator<Item = &str> { return self.1.iter().flat_map(|context| context.iter_plain()); } |