use core::iter; use crate::alloc::AllocationMode; pub(crate) fn modes() -> impl Iterator { use AllocationMode::*; [Constant, Input, Witness].into_iter() } pub(crate) fn combination( mut i: impl Iterator, ) -> impl Iterator { iter::from_fn(move || i.next().map(|t| modes().map(move |mode| (mode, t.clone())))) .flat_map(|x| x) }