diff --git a/ceno_zkvm/src/circuit_builder.rs b/ceno_zkvm/src/circuit_builder.rs index b5a8cd13b..80a437f26 100644 --- a/ceno_zkvm/src/circuit_builder.rs +++ b/ceno_zkvm/src/circuit_builder.rs @@ -420,8 +420,8 @@ impl ConstraintSystem { pub fn namespace, N: FnOnce() -> NR, T>( &mut self, name_fn: N, - cb: impl FnOnce(&mut ConstraintSystem) -> Result, - ) -> Result { + cb: impl FnOnce(&mut ConstraintSystem) -> T, + ) -> T { self.ns.push_namespace(name_fn().into()); let t = cb(self); self.ns.pop_namespace(); diff --git a/ceno_zkvm/src/instructions/riscv/test.rs b/ceno_zkvm/src/instructions/riscv/test.rs index 09456f269..6513cd1f7 100644 --- a/ceno_zkvm/src/instructions/riscv/test.rs +++ b/ceno_zkvm/src/instructions/riscv/test.rs @@ -16,19 +16,11 @@ fn test_multiple_opcode() { let mut cs = ConstraintSystem::new(|| "riscv"); let _add_config = cs.namespace( || "add", - |cs| { - let mut circuit_builder = CircuitBuilder::::new(cs); - let config = AddInstruction::construct_circuit(&mut circuit_builder); - Ok(config) - }, + |cs| AddInstruction::construct_circuit(&mut CircuitBuilder::::new(cs)), ); let _sub_config = cs.namespace( || "sub", - |cs| { - let mut circuit_builder = CircuitBuilder::::new(cs); - let config = SubInstruction::construct_circuit(&mut circuit_builder); - Ok(config) - }, + |cs| SubInstruction::construct_circuit(&mut CircuitBuilder::::new(cs)), ); let param = Pcs::setup(1 << 10).unwrap(); let (pp, _) = Pcs::trim(¶m, 1 << 10).unwrap();