Skip to content

Commit 479fbe0

Browse files
committed
Fix some clippy complaints
1 parent 28723d2 commit 479fbe0

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

crates/accelerate/src/unitary_synthesis.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
// copyright notice, and modified files need to carry a notice indicating
1111
// that they have been altered from the originals.
1212

13-
// #[cfg(feature = "cache_pygates")]
13+
#[cfg(feature = "cache_pygates")]
1414
use std::cell::OnceCell;
1515
use std::f64::consts::PI;
1616
use std::hash::Hash;
@@ -60,7 +60,7 @@ enum DecomposerType {
6060

6161
#[derive(Clone, Debug)]
6262
enum UnitarySynthesisReturnType {
63-
DAGType(DAGCircuit),
63+
DAGType(Box<DAGCircuit>),
6464
TwoQSequenceType(TwoQubitUnitarySequence),
6565
}
6666

@@ -185,7 +185,7 @@ fn dag_from_2q_gate_sequence(
185185
clbits: target_dag.cargs_interner.get_default(),
186186
params: new_params,
187187
extra_attrs: None,
188-
// #[cfg(feature = "cache_pygates")]
188+
#[cfg(feature = "cache_pygates")]
189189
py_op: OnceCell::new(),
190190
};
191191
instructions.push(pi);
@@ -423,7 +423,7 @@ fn py_run_default_main_loop(
423423
UnitarySynthesisReturnType::DAGType(synth_dag) => synth_dag,
424424
UnitarySynthesisReturnType::TwoQSequenceType(
425425
synth_sequence,
426-
) => dag_from_2q_gate_sequence(py, synth_sequence)?,
426+
) => Box::new(dag_from_2q_gate_sequence(py, synth_sequence)?),
427427
};
428428

429429
let _ = out_dag.set_global_phase(add_global_phase(
@@ -1060,7 +1060,7 @@ fn synth_su4(
10601060
};
10611061

10621062
match preferred_direction {
1063-
None => Ok(UnitarySynthesisReturnType::DAGType(synth_dag)),
1063+
None => Ok(UnitarySynthesisReturnType::DAGType(Box::new(synth_dag))),
10641064
Some(preferred_dir) => {
10651065
let mut synth_direction: Option<Vec<u32>> = None;
10661066
for node in synth_dag.topological_op_nodes()? {
@@ -1074,7 +1074,7 @@ fn synth_su4(
10741074
}
10751075
// synth direction is in the relative basis
10761076
match synth_direction {
1077-
None => Ok(UnitarySynthesisReturnType::DAGType(synth_dag)),
1077+
None => Ok(UnitarySynthesisReturnType::DAGType(Box::new(synth_dag))),
10781078
Some(synth_direction) => {
10791079
let synth_dir = match synth_direction.as_slice() {
10801080
[0, 1] => true,
@@ -1090,7 +1090,7 @@ fn synth_su4(
10901090
decomposer_gate_params,
10911091
)
10921092
} else {
1093-
Ok(UnitarySynthesisReturnType::DAGType(synth_dag))
1093+
Ok(UnitarySynthesisReturnType::DAGType(Box::new(synth_dag)))
10941094
}
10951095
}
10961096
}
@@ -1227,7 +1227,7 @@ fn reversed_synth_su4(
12271227
let _ = target_dag.push_back(py, inst.clone());
12281228
}
12291229
}
1230-
Ok(UnitarySynthesisReturnType::DAGType(target_dag))
1230+
Ok(UnitarySynthesisReturnType::DAGType(Box::new(target_dag)))
12311231
}
12321232

12331233
#[pymodule]

0 commit comments

Comments
 (0)