@@ -117,11 +117,12 @@ mod tests {
117117 [ true ] ,
118118 10_000 ,
119119 |circuit, wire| {
120- let [ mut wire] = * wire;
121- circuit. add_gate ( Gate :: not ( & mut wire) ) ;
122- circuit. add_gate ( Gate :: not ( & mut wire) ) ;
123-
124- vec ! [ wire]
120+ let [ wire] = * wire;
121+ let wire_not = circuit. issue_wire ( ) ;
122+ circuit. add_gate ( Gate :: not ( wire, wire_not) ) ;
123+ let wire_not_not = circuit. issue_wire ( ) ;
124+ circuit. add_gate ( Gate :: not ( wire_not, wire_not_not) ) ;
125+ vec ! [ wire_not_not]
125126 } ,
126127 )
127128 . output_value [ 0 ] ;
@@ -131,12 +132,14 @@ mod tests {
131132 [ true ] ,
132133 10_000 ,
133134 |circuit, wire| {
134- let [ mut wire] = * wire;
135- circuit. add_gate ( Gate :: not ( & mut wire) ) ;
136- circuit. add_gate ( Gate :: not ( & mut wire) ) ;
137- circuit. add_gate ( Gate :: not ( & mut wire) ) ;
138-
139- vec ! [ wire]
135+ let [ wire] = * wire;
136+ let wire_not = circuit. issue_wire ( ) ;
137+ circuit. add_gate ( Gate :: not ( wire, wire_not) ) ;
138+ let wire_not_not = circuit. issue_wire ( ) ;
139+ circuit. add_gate ( Gate :: not ( wire_not, wire_not_not) ) ;
140+ let wire_not_not_not = circuit. issue_wire ( ) ;
141+ circuit. add_gate ( Gate :: not ( wire_not_not, wire_not_not_not) ) ;
142+ vec ! [ wire_not_not_not]
140143 } ,
141144 )
142145 . output_value [ 0 ] ;
@@ -150,13 +153,17 @@ mod tests {
150153 [ true , true ] ,
151154 10_000 ,
152155 |circuit, wires| {
153- let [ mut a_wire, mut b_wire] = * wires;
156+ let [ a_wire, b_wire] = * wires;
154157
155- circuit. add_gate ( Gate :: not ( & mut a_wire) ) ;
156- circuit. add_gate ( Gate :: not ( & mut a_wire) ) ;
158+ let a_wire_not = circuit. issue_wire ( ) ;
159+ circuit. add_gate ( Gate :: not ( a_wire, a_wire_not) ) ;
160+ let a_wire_not2 = circuit. issue_wire ( ) ;
161+ circuit. add_gate ( Gate :: not ( a_wire_not, a_wire_not2) ) ;
157162
158- circuit. add_gate ( Gate :: not ( & mut b_wire) ) ;
159- circuit. add_gate ( Gate :: not ( & mut b_wire) ) ;
163+ let b_wire_not = circuit. issue_wire ( ) ;
164+ circuit. add_gate ( Gate :: not ( b_wire, b_wire_not) ) ;
165+ let b_wire_not2 = circuit. issue_wire ( ) ;
166+ circuit. add_gate ( Gate :: not ( b_wire_not, b_wire_not2) ) ;
160167
161168 let res = circuit. issue_wire ( ) ;
162169 circuit. add_gate ( Gate :: and ( a_wire, b_wire, res) ) ;
0 commit comments