From e23a446ec22bf367554fe555b6366586fd613194 Mon Sep 17 00:00:00 2001 From: Martin Thomson Date: Fri, 24 Nov 2023 11:23:40 +1100 Subject: [PATCH] Cap the iterator that comes out of BitArr --- src/ff/boolean_array.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ff/boolean_array.rs b/src/ff/boolean_array.rs index 706a79b93..a69bb86ae 100644 --- a/src/ff/boolean_array.rs +++ b/src/ff/boolean_array.rs @@ -27,7 +27,7 @@ macro_rules! store_impl { /// iterator for Boolean arrays pub struct BAIterator<'a> { - iterator: Iter<'a, u8, Lsb0>, + iterator: std::iter::Take>, } ///impl Iterator for all Boolean arrays @@ -228,7 +228,7 @@ macro_rules! boolean_array_impl { fn into_iter(self) -> Self::IntoIter { BAIterator { - iterator: self.0.iter(), + iterator: self.0.iter().take(usize::try_from(<$name>::BITS).unwrap()), } } }