diff --git a/msm/src/witness.rs b/msm/src/witness.rs index abb60e952e..b48cbcddb8 100644 --- a/msm/src/witness.rs +++ b/msm/src/witness.rs @@ -21,6 +21,17 @@ impl Default for Witness { // IMPLEMENTATION OF ITERATORS FOR THE WITNESS STRUCTURE +impl<'lt, const N: usize, G> IntoIterator for &'lt Witness { + type Item = &'lt G; + type IntoIter = std::vec::IntoIter<&'lt G>; + + fn into_iter(self) -> Self::IntoIter { + let mut iter_contents = Vec::with_capacity(N); + iter_contents.extend(&self.cols); + iter_contents.into_iter() + } +} + impl IntoIterator for Witness { type Item = F; type IntoIter = std::vec::IntoIter;