Skip to content

Commit

Permalink
Fix cargo clippy and rustfmt for Rust 1.79 (Qiskit#12710)
Browse files Browse the repository at this point in the history
After the recently merged Qiskit#12543 when working with Rust 1.79 cargo fmt
makes a small formatting change that rust 1.70 wouldn't and clippy makes
flags a &Vec<_> that should be a slice &[_] instead. This commit makes
these two small chagnes so they're not an issue for people building with
the latest stable version of rust, not just our MSRV.
  • Loading branch information
mtreinish authored and Procatv committed Aug 1, 2024
1 parent 1d4463d commit 0a9daeb
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions crates/accelerate/src/synthesis/permutation/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,10 @@ pub fn pattern_to_cycles(pattern: &ArrayView1<usize>) -> Vec<Vec<usize>> {
/// Periodic (or Python-like) access to a vector.
/// Util used below in ``decompose_cycles``.
#[inline]
fn pget(vec: &Vec<usize>, index: isize) -> Result<usize, PySequenceIndexError> {
let SequenceIndex::Int(wrapped) = PySequenceIndex::Int(index).with_len(vec.len())? else {unreachable!()};
fn pget(vec: &[usize], index: isize) -> Result<usize, PySequenceIndexError> {
let SequenceIndex::Int(wrapped) = PySequenceIndex::Int(index).with_len(vec.len())? else {
unreachable!()
};
Ok(vec[wrapped])
}

Expand Down

0 comments on commit 0a9daeb

Please sign in to comment.