|
1 | | -use std::iter::{once, repeat_n}; |
| 1 | +use std::iter::once; |
2 | 2 |
|
3 | 3 | use openvm_circuit::{arch::instructions::program::Program, utils::air_test_impl}; |
4 | 4 | #[cfg(feature = "cuda")] |
@@ -35,12 +35,10 @@ fn test_sumcheck_layer_eval_with_hint_ids() { |
35 | 35 | let num_logup_specs = 8; |
36 | 36 |
|
37 | 37 | let prod_evals: Vec<E> = (0..(num_prod_specs * num_layers * 2)) |
38 | | - .into_iter() |
39 | 38 | .map(|_| new_rand_ext(&mut rng)) |
40 | 39 | .collect(); |
41 | 40 |
|
42 | 41 | let logup_evals: Vec<E> = (0..(num_logup_specs * num_layers * 4)) |
43 | | - .into_iter() |
44 | 42 | .map(|_| new_rand_ext(&mut rng)) |
45 | 43 | .collect(); |
46 | 44 |
|
@@ -73,13 +71,10 @@ fn test_sumcheck_layer_eval_with_hint_ids() { |
73 | 71 | standard_fri_params_with_100_bits_conjectured_security(1) |
74 | 72 | }; |
75 | 73 |
|
76 | | - let mut input_stream: Vec<Vec<F>> = vec![]; |
77 | | - input_stream.push( |
78 | | - prod_evals |
79 | | - .into_iter() |
80 | | - .flat_map(|e| <E as FieldExtensionAlgebra<F>>::as_base_slice(&e).to_vec()) |
81 | | - .collect(), |
82 | | - ); |
| 74 | + let mut input_stream: Vec<Vec<F>> = vec![prod_evals |
| 75 | + .into_iter() |
| 76 | + .flat_map(|e| <E as FieldExtensionAlgebra<F>>::as_base_slice(&e).to_vec()) |
| 77 | + .collect()]; |
83 | 78 | input_stream.push( |
84 | 79 | logup_evals |
85 | 80 | .into_iter() |
@@ -137,7 +132,7 @@ fn build_test_program<C: Config>( |
137 | 132 | ) { |
138 | 133 | let mode = 1; // current_layer |
139 | 134 |
|
140 | | - let mut ctx_u32s = vec![ |
| 135 | + let ctx_u32s = vec![ |
141 | 136 | round, |
142 | 137 | num_prod_specs, |
143 | 138 | num_logup_specs, |
@@ -175,16 +170,16 @@ fn build_test_program<C: Config>( |
175 | 170 |
|
176 | 171 | let num_prod_evals = num_prod_specs * num_layers * 2; |
177 | 172 | let prod_spec_evals: Array<C, Ext<C::F, C::EF>> = builder.dyn_array(num_prod_evals); |
178 | | - for idx in 0..num_prod_evals { |
179 | | - let e: Ext<C::F, C::EF> = builder.constant(prod_evals[idx]); |
| 173 | + for (idx, prod_eval) in prod_evals.into_iter().enumerate() { |
| 174 | + let e: Ext<C::F, C::EF> = builder.constant(prod_eval); |
180 | 175 |
|
181 | 176 | builder.set(&prod_spec_evals, idx, e); |
182 | 177 | } |
183 | 178 |
|
184 | 179 | let num_logup_evals = num_logup_specs * num_layers * 4; |
185 | 180 | let logup_spec_evals: Array<C, Ext<C::F, C::EF>> = builder.dyn_array(num_logup_evals); |
186 | | - for idx in 0..num_logup_evals { |
187 | | - let e: Ext<C::F, C::EF> = builder.constant(logup_evals[idx]); |
| 181 | + for (idx, logup_eval) in logup_evals.into_iter().enumerate() { |
| 182 | + let e: Ext<C::F, C::EF> = builder.constant(logup_eval); |
188 | 183 |
|
189 | 184 | builder.set(&logup_spec_evals, idx, e); |
190 | 185 | } |
|
0 commit comments