From c2439557bfec209b5e932c576c4812c4690beb0c Mon Sep 17 00:00:00 2001 From: Nicholas Ward Date: Mon, 30 Aug 2021 13:03:46 -0700 Subject: [PATCH] fix --- src/gates/switch.rs | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/src/gates/switch.rs b/src/gates/switch.rs index 9dbf9ee4..50104b82 100644 --- a/src/gates/switch.rs +++ b/src/gates/switch.rs @@ -161,11 +161,17 @@ impl, const D: usize, const CHUNK_SIZE: usize> Gate gate_index: usize, _local_constants: &[F], ) -> Vec>> { - (0..self.num_copies).map(|c| Box::new(SwitchGenerator:: { - gate_index, - gate: self.clone(), - copy: c, - })).collect() + (0..self.num_copies) + .map(|c| { + let g: Box> = + Box::new(SwitchGenerator:: { + gate_index, + gate: self.clone(), + copy: c, + }); + g + }) + .collect() } fn num_wires(&self) -> usize { @@ -230,10 +236,12 @@ impl, const D: usize, const CHUNK_SIZE: usize> SimpleGenerator< self.copy, )); for e in 0..CHUNK_SIZE { - let first_input = - get_local_wire(SwitchGate::::wire_first_input(self.copy, e)); - let first_output = - get_local_wire(SwitchGate::::wire_first_output(self.copy, e)); + let first_input = get_local_wire(SwitchGate::::wire_first_input( + self.copy, e, + )); + let first_output = get_local_wire(SwitchGate::::wire_first_output( + self.copy, e, + )); if first_input == first_output { out_buffer.set_wire(switch_bool_wire, F::ONE);