diff options
author | Ryan Lahfa <tvl@lahfa.xyz> | 2023-12-26T01·18+0100 |
---|---|---|
committer | clbot <clbot@tvl.fyi> | 2024-01-03T18·20+0000 |
commit | 09ec8b6fcf6ea5c04193c4539e4265a5c11a3386 (patch) | |
tree | ca58bccfa032b7a4cf5e8ac54fedb83727ee108e /tvix/eval/src/value | |
parent | 96d06031affefeb0ee312e5fa5a6fcea29a7dff9 (diff) |
feat(tvix/eval): implement `getContext` primop r/7331
Change-Id: I2c5068a28f9883a01b0ff80a5e5ab32ba18bfc1a Reviewed-on: https://cl.tvl.fyi/c/depot/+/10437 Reviewed-by: tazjin <tazjin@tvl.su> Autosubmit: raitobezarius <tvl@lahfa.xyz> Tested-by: BuildkiteCI
Diffstat (limited to 'tvix/eval/src/value')
-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 aa82ed36eb40..c528fd19f229 100644 --- a/tvix/eval/src/value/string.rs +++ b/tvix/eval/src/value/string.rs @@ -326,6 +326,10 @@ impl NixString { return self.1.as_mut(); } + pub fn iter_context(&self) -> impl Iterator<Item = &NixContext> { + return self.1.iter(); + } + pub fn iter_plain(&self) -> impl Iterator<Item = &str> { return self.1.iter().flat_map(|context| context.iter_plain()); } |