Merge pull request #1460 from zcash/1273-fix-no-default-features

zcash_client_sqlite: Fix `--no-default-features` compilation
This commit is contained in:
Jack Grigg 2024-07-26 02:21:29 +01:00 committed by GitHub
commit 001f278531
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 18 additions and 4 deletions

View File

@ -33,10 +33,6 @@
#![deny(rustdoc::broken_intra_doc_links)]
use incrementalmerkletree::{Marking, Position, Retention};
use maybe_rayon::{
prelude::{IndexedParallelIterator, ParallelIterator},
slice::ParallelSliceMut,
};
use nonempty::NonEmpty;
use rusqlite::{self, Connection};
use secrecy::{ExposeSecret, SecretVec};
@ -95,6 +91,24 @@ use {
},
};
#[cfg(feature = "multicore")]
use maybe_rayon::{
prelude::{IndexedParallelIterator, ParallelIterator},
slice::ParallelSliceMut,
};
/// `maybe-rayon` doesn't provide this as a fallback, so we have to.
#[cfg(not(feature = "multicore"))]
trait ParallelSliceMut<T> {
fn par_chunks_mut(&mut self, chunk_size: usize) -> std::slice::ChunksMut<'_, T>;
}
#[cfg(not(feature = "multicore"))]
impl<T> ParallelSliceMut<T> for [T] {
fn par_chunks_mut(&mut self, chunk_size: usize) -> std::slice::ChunksMut<'_, T> {
self.chunks_mut(chunk_size)
}
}
#[cfg(feature = "unstable")]
use {
crate::chain::{fsblockdb_with_blocks, BlockMeta},