From: Ian Jackson Date: Sun, 28 Feb 2021 20:49:44 +0000 (+0000) Subject: utils: provide IntoIterator for OldNew X-Git-Tag: otter-0.4.0~265 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=1e94d1f5a4f62215d318be160d3b16a56db916e2;p=otter.git 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 --- 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 {