Skip to content

Commit

Permalink
Merge pull request zcash#1460 from zcash/1273-fix-no-default-features
Browse files Browse the repository at this point in the history
zcash_client_sqlite: Fix `--no-default-features` compilation
  • Loading branch information
str4d committed Jul 26, 2024
2 parents b9e37d0 + 7c6bf5c commit 001f278
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions zcash_client_sqlite/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down Expand Up @@ -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},
Expand Down

0 comments on commit 001f278

Please sign in to comment.