From 1e94d1f5a4f62215d318be160d3b16a56db916e2 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sun, 28 Feb 2021 20:49:44 +0000 Subject: [PATCH] utils: provide IntoIterator for OldNew I wanted this for a now-abandoned approach to something, but let us keep it. Signed-off-by: Ian Jackson --- src/utils.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/utils.rs b/src/utils.rs index bd79992d..a062eb97 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -77,6 +77,10 @@ impl OldNew { pub fn iter(&self) -> impl Iterator { self.0.iter() } + + pub fn into_iter(self) -> impl Iterator { + std::array::IntoIter::new(self.0) + } } impl Index for OldNew { -- 2.30.2