@@ -333,7 +333,7 @@ impl<'h> PytketDecoderContext<'h> {
333333 /// Decode a list of pytket commands.
334334 pub ( super ) fn run_decoder (
335335 & mut self ,
336- commands : Vec < circuit_json:: Command > ,
336+ commands : & [ circuit_json:: Command ] ,
337337 ) -> Result < ( ) , PytketDecodeError > {
338338 let config = self . config . clone ( ) ;
339339 for com in commands {
@@ -348,13 +348,13 @@ impl<'h> PytketDecoderContext<'h> {
348348 /// decoder.
349349 pub ( super ) fn process_command (
350350 & mut self ,
351- command : circuit_json:: Command ,
351+ command : & circuit_json:: Command ,
352352 config : & PytketDecoderConfig ,
353353 ) -> Result < ( ) , PytketDecodeError > {
354354 let circuit_json:: Command { op, args, opgroup } = command;
355355
356356 // Find the latest [`TrackedQubit`] and [`TrackedBit`] for the command registers.
357- let ( qubits, bits) = self . wire_tracker . pytket_args_to_tracked_elems ( & args) ?;
357+ let ( qubits, bits) = self . wire_tracker . pytket_args_to_tracked_elems ( args) ?;
358358
359359 // Collect the parameters used in the command.
360360 let params: Vec < Arc < LoadedParameter > > = match & op. params {
@@ -366,12 +366,12 @@ impl<'h> PytketDecoderContext<'h> {
366366 } ;
367367
368368 // Try to decode the command with the configured decoders.
369- match config. op_to_hugr ( & op, & qubits, & bits, & params, & opgroup, self ) ? {
369+ match config. op_to_hugr ( op, & qubits, & bits, & params, opgroup, self ) ? {
370370 DecodeStatus :: Success => { }
371371 DecodeStatus :: Unsupported => {
372372 // The command couldn't be translated into a native HUGR counterpart, so
373373 // we generate an opaque `Tk1Op` instead.
374- build_opaque_tket_op ( op, & qubits, & bits, & params, & opgroup, self ) ?;
374+ build_opaque_tket_op ( op, & qubits, & bits, & params, opgroup, self ) ?;
375375 }
376376 }
377377 Ok ( ( ) )
0 commit comments