Skip to content

Commit

Permalink
Merge pull request #858 from martinthomson/take-n-ba
Browse files Browse the repository at this point in the history
Cap the iterator that comes out of BitArr
  • Loading branch information
benjaminsavage authored Nov 24, 2023
2 parents be5e304 + e23a446 commit 20224b7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ff/boolean_array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Iter<'a, u8, Lsb0>>,
}

///impl Iterator for all Boolean arrays
Expand Down Expand Up @@ -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()),
}
}
}
Expand Down

0 comments on commit 20224b7

Please sign in to comment.