Skip to content

Commit c2477ab

Browse files
authored
Fix stable clippy warnings (#16052)
This commit fixes clippy warnings that appear when running clippy from the latest stable Rust release 1.95.0. Fixing this pre-emptively will avoid errors when we try to bump our MSRV in the future and also fix the error for those of use that insist on testing with the latest stable release of Rust and are seeing clippy complain about this.
1 parent 62cb08b commit c2477ab

3 files changed

Lines changed: 6 additions & 10 deletions

File tree

crates/circuit/src/circuit_data.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -984,12 +984,12 @@ impl CircuitData {
984984
pub fn pack(&mut self, py: Python, inst: &CircuitInstruction) -> PyResult<PackedInstruction> {
985985
let qubits = self.qargs_interner.insert_owned(
986986
self.qubits
987-
.map_objects(inst.qubits.extract::<Vec<ShareableQubit>>(py)?.into_iter())?
987+
.map_objects(inst.qubits.extract::<Vec<ShareableQubit>>(py)?)?
988988
.collect(),
989989
);
990990
let clbits = self.cargs_interner.insert_owned(
991991
self.clbits
992-
.map_objects(inst.clbits.extract::<Vec<ShareableClbit>>(py)?.into_iter())?
992+
.map_objects(inst.clbits.extract::<Vec<ShareableClbit>>(py)?)?
993993
.collect(),
994994
);
995995
let params = self.extract_blocks_from_circuit_parameters(inst.params.as_ref());

crates/circuit/src/dag_circuit.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6391,8 +6391,7 @@ impl DAGCircuit {
63916391
op_node
63926392
.instruction
63936393
.qubits
6394-
.extract::<Vec<ShareableQubit>>(py)?
6395-
.into_iter(),
6394+
.extract::<Vec<ShareableQubit>>(py)?,
63966395
)?
63976396
.collect(),
63986397
);
@@ -6402,8 +6401,7 @@ impl DAGCircuit {
64026401
op_node
64036402
.instruction
64046403
.clbits
6405-
.extract::<Vec<ShareableClbit>>(py)?
6406-
.into_iter(),
6404+
.extract::<Vec<ShareableClbit>>(py)?,
64076405
)?
64086406
.collect(),
64096407
);

crates/synthesis/src/discrete_basis/math.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,8 @@ fn rotation_axis_from_so3(matrix: &Matrix3<f64>, do_checks: bool) -> Matrix3x1<f
106106
axis[2] *= -1.;
107107
}
108108
}
109-
1 => {
110-
if matrix[(1, 2)] < 0. {
111-
axis[2] *= -1.;
112-
}
109+
1 if matrix[(1, 2)] < 0. => {
110+
axis[2] *= -1.;
113111
}
114112
_ => (),
115113
};

0 commit comments

Comments
 (0)