fix(trie): silence unused param warnings in sparse-parallel no_std build (#21657)

This commit is contained in:
かりんとう
2026-02-01 14:05:39 +01:00
committed by GitHub
parent 34cc65cfe6
commit 9be31d504d

View File

@@ -1297,18 +1297,30 @@ impl ParallelSparseTrie {
/// Will always return false in nostd builds.
const fn is_reveal_parallelism_enabled(&self, num_nodes: usize) -> bool {
#[cfg(not(feature = "std"))]
return false;
{
let _ = num_nodes;
return false;
}
num_nodes >= self.parallelism_thresholds.min_revealed_nodes
#[cfg(feature = "std")]
{
num_nodes >= self.parallelism_thresholds.min_revealed_nodes
}
}
/// Returns true if parallelism should be enabled for updating hashes with the given number
/// of changed keys. Will always return false in nostd builds.
const fn is_update_parallelism_enabled(&self, num_changed_keys: usize) -> bool {
#[cfg(not(feature = "std"))]
return false;
{
let _ = num_changed_keys;
return false;
}
num_changed_keys >= self.parallelism_thresholds.min_updated_nodes
#[cfg(feature = "std")]
{
num_changed_keys >= self.parallelism_thresholds.min_updated_nodes
}
}
/// Checks if an error is retriable (`BlindedNode` or `NodeNotFoundInProvider`) and extracts