From 9be31d504d5b592a40b29941124421ef0abafe42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=8B=E3=82=8A=E3=82=93=E3=81=A8=E3=81=86?= Date: Sun, 1 Feb 2026 14:05:39 +0100 Subject: [PATCH] fix(trie): silence unused param warnings in sparse-parallel no_std build (#21657) --- crates/trie/sparse-parallel/src/trie.rs | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/crates/trie/sparse-parallel/src/trie.rs b/crates/trie/sparse-parallel/src/trie.rs index ab6f8ff951..52aa0242af 100644 --- a/crates/trie/sparse-parallel/src/trie.rs +++ b/crates/trie/sparse-parallel/src/trie.rs @@ -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