diff options
author | Adam Joseph <adam@westernsemico.com> | 2023-12-08T09·41-0800 |
---|---|---|
committer | clbot <clbot@tvl.fyi> | 2023-12-09T11·35+0000 |
commit | 5fd42a9e70cfbb3e9351d21e9e23df7b0d6feea6 (patch) | |
tree | f0ba86e4936e91acd9076fb6f311ec751a44b11b /tvix/eval/src | |
parent | 36c3e646e12622c1be6032f72bc1569d5b6a23d7 (diff) |
feat(tvix/eval): impl DoubleEndedIter for OwnedAttrsIterator r/7130
Change-Id: I4bd85dbe9c27047f4abbdeff4e2b796e9bcab3a1 Reviewed-on: https://cl.tvl.fyi/c/depot/+/10211 Reviewed-by: tazjin <tazjin@tvl.su> Autosubmit: Adam Joseph <adam@westernsemico.com> Tested-by: BuildkiteCI
Diffstat (limited to 'tvix/eval/src')
-rw-r--r-- | tvix/eval/src/value/attrs.rs | 10 |
1 files changed, 10 insertions, 0 deletions
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<Self::Item> { + match &mut self.0 { + IntoIterRepr::Empty => None, + IntoIterRepr::Finite(inner) => inner.next_back(), + IntoIterRepr::Im(inner) => inner.next_back(), + } + } +} |