ark-r1cs-std/src/test_utils.rs
src/test_utils.rsRaw
1use core::iter;
2
3use crate::alloc::AllocationMode;
4
5pub(crate) fn modes() -> impl Iterator<Item = AllocationMode> {
6 use AllocationMode::*;
7 [Constant, Input, Witness].into_iter()
8}
9
10pub(crate) fn combination<T: Clone>(
11 mut i: impl Iterator<Item = T>,
12) -> impl Iterator<Item = (AllocationMode, T)> {
13 iter::from_fn(move || i.next().map(|t| modes().map(move |mode| (mode, t.clone()))))
14 .flat_map(|x| x)
15}