Skip to content

Commit

Permalink
Use {integer}::div_ceil where appropriate (#13716)
Browse files Browse the repository at this point in the history
The method was added in Rust 1.73, which was previously above our MSRV.
Recent clippy versions now warn against the workaround on complexity
grounds, since our MSRV indicates we can use the built-in version.
  • Loading branch information
jakelishman authored Jan 22, 2025
1 parent ff57b23 commit e9ccd3f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crates/accelerate/src/sparse_pauli_op.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1161,7 +1161,7 @@ macro_rules! impl_to_matrix_sparse {
// to keep threads busy by subdivision with minimizing overhead; we're setting the
// chunk size such that the iterator will have as many elements as there are threads.
let num_threads = rayon::current_num_threads();
let chunk_size = (side + num_threads - 1) / num_threads;
let chunk_size = side.div_ceil(num_threads);
let mut values_chunks = Vec::with_capacity(num_threads);
let mut indices_chunks = Vec::with_capacity(num_threads);
// SAFETY: the slice here is uninitialised data; it must not be read.
Expand Down

0 comments on commit e9ccd3f

Please sign in to comment.