From 5fd42a9e70cfbb3e9351d21e9e23df7b0d6feea6 Mon Sep 17 00:00:00 2001 From: Adam Joseph Date: Fri, 8 Dec 2023 01:41:22 -0800 Subject: feat(tvix/eval): impl DoubleEndedIter for OwnedAttrsIterator Change-Id: I4bd85dbe9c27047f4abbdeff4e2b796e9bcab3a1 Reviewed-on: https://cl.tvl.fyi/c/depot/+/10211 Reviewed-by: tazjin Autosubmit: Adam Joseph Tested-by: BuildkiteCI --- tvix/eval/src/value/attrs.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'tvix/eval') diff --git a/tvix/eval/src/value/attrs.rs b/tvix/eval/src/value/attrs.rs index 10bdee4eba3a..03183810f24b 100644 --- a/tvix/eval/src/value/attrs.rs +++ b/tvix/eval/src/value/attrs.rs @@ -615,3 +615,13 @@ impl ExactSizeIterator for OwnedAttrsIterator { } } } + +impl DoubleEndedIterator for OwnedAttrsIterator { + fn next_back(&mut self) -> Option { + match &mut self.0 { + IntoIterRepr::Empty => None, + IntoIterRepr::Finite(inner) => inner.next_back(), + IntoIterRepr::Im(inner) => inner.next_back(), + } + } +} -- cgit 1.4.1