Skip to content

Commit 792fbcd

Browse files
committed
Fix clippy complaints
1 parent 0bad00d commit 792fbcd

3 files changed

Lines changed: 9 additions & 13 deletions

File tree

crates/circuit/src/operations.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -430,11 +430,11 @@ impl ControlFlowInstruction {
430430
}
431431
_ => Ok(false),
432432
},
433-
ControlFlow::BreakLoop {} => match &other.control_flow {
433+
ControlFlow::BreakLoop => match &other.control_flow {
434434
ControlFlow::BreakLoop => Ok(true),
435435
_ => Ok(false),
436436
},
437-
ControlFlow::ContinueLoop {} => match &other.control_flow {
437+
ControlFlow::ContinueLoop => match &other.control_flow {
438438
ControlFlow::ContinueLoop => Ok(true),
439439
_ => Ok(false),
440440
},
@@ -572,8 +572,8 @@ impl Operation for ControlFlowInstruction {
572572
fn name(&self) -> &str {
573573
match &self.control_flow {
574574
ControlFlow::Box { .. } => "box",
575-
ControlFlow::BreakLoop { .. } => "break_loop",
576-
ControlFlow::ContinueLoop { .. } => "continue_loop",
575+
ControlFlow::BreakLoop => "break_loop",
576+
ControlFlow::ContinueLoop => "continue_loop",
577577
ControlFlow::ForLoop { .. } => "for_loop",
578578
ControlFlow::IfElse { .. } => "if_else",
579579
ControlFlow::Switch { .. } => "switch_case",
@@ -592,8 +592,8 @@ impl Operation for ControlFlowInstruction {
592592
fn num_params(&self) -> u32 {
593593
match &self.control_flow {
594594
ControlFlow::Box { .. } => 1,
595-
ControlFlow::BreakLoop { .. } => 0,
596-
ControlFlow::ContinueLoop { .. } => 0,
595+
ControlFlow::BreakLoop => 0,
596+
ControlFlow::ContinueLoop => 0,
597597
ControlFlow::ForLoop { .. } => 3,
598598
ControlFlow::IfElse { .. } => 2,
599599
ControlFlow::Switch { cases, .. } => *cases,

crates/circuit/src/packed_instruction.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -515,11 +515,11 @@ impl PackedOperation {
515515
ControlFlow::Box { .. } => {
516516
BOX_OP.get_bound(py).cast::<PyType>()?.is_subclass(py_type)
517517
}
518-
ControlFlow::BreakLoop { .. } => BREAK_LOOP_OP
518+
ControlFlow::BreakLoop => BREAK_LOOP_OP
519519
.get_bound(py)
520520
.cast::<PyType>()?
521521
.is_subclass(py_type),
522-
ControlFlow::ContinueLoop { .. } => CONTINUE_LOOP_OP
522+
ControlFlow::ContinueLoop => CONTINUE_LOOP_OP
523523
.get_bound(py)
524524
.cast::<PyType>()?
525525
.is_subclass(py_type),

crates/transpiler/src/passes/gates_in_basis.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,7 @@ pub fn gates_missing_from_target(dag: &DAGCircuit, target: &Target) -> PyResult<
4545
if !target.instruction_supported(
4646
gate.op.name(),
4747
&qargs_mapped,
48-
gate.op
49-
.try_control_flow()
50-
.is_none()
51-
.then_some(gate.params_view())
52-
.unwrap_or_default(),
48+
gate.params_view(),
5349
!gate.is_parameterized() && gate.op.try_control_flow().is_none(),
5450
) {
5551
return Ok(true);

0 commit comments

Comments
 (0)