diff options
author | Vincent Ambo <mail@tazj.in> | 2022-08-31T01·47+0300 |
---|---|---|
committer | tazjin <tazjin@tvl.su> | 2022-09-07T19·08+0000 |
commit | 6c6f9ae66123ea3e9e6cdc78bdb55ace712535a1 (patch) | |
tree | 98bc59c94f86716098e106e4cd191eed0e41c082 /tvix/eval/src | |
parent | fea7f90a7fa6024241cfc9bae7f8b9cc6e7ba13a (diff) |
feat(tvix/eval): implement NixList::iter r/4704
This does not require a custom iterator type (for now?) Change-Id: I5beb194bd8629571bd4040c69c977c27149807fa Reviewed-on: https://cl.tvl.fyi/c/depot/+/6371 Reviewed-by: sterni <sternenseemann@systemli.org> Tested-by: BuildkiteCI
Diffstat (limited to 'tvix/eval/src')
-rw-r--r-- | tvix/eval/src/value/list.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tvix/eval/src/value/list.rs b/tvix/eval/src/value/list.rs index 77776c4dce62..b8682a5b3d5a 100644 --- a/tvix/eval/src/value/list.rs +++ b/tvix/eval/src/value/list.rs @@ -39,6 +39,10 @@ impl NixList { NixList(stack_slice) } + pub fn iter(&self) -> std::slice::Iter<Value> { + self.0.iter() + } + pub fn into_iter(self) -> std::vec::IntoIter<Value> { self.0.into_iter() } |