From 6c6f9ae66123ea3e9e6cdc78bdb55ace712535a1 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Wed, 31 Aug 2022 04:47:20 +0300 Subject: [PATCH] feat(tvix/eval): implement NixList::iter 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 Tested-by: BuildkiteCI --- tvix/eval/src/value/list.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tvix/eval/src/value/list.rs b/tvix/eval/src/value/list.rs index 77776c4dc..b8682a5b3 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 { + self.0.iter() + } + pub fn into_iter(self) -> std::vec::IntoIter { self.0.into_iter() }