From c02a68dc78eb4e080288ed6779439fd1d3169667 Mon Sep 17 00:00:00 2001 From: Yong Kang Date: Fri, 10 Oct 2025 12:43:21 +0000 Subject: [PATCH] refactor: improve error handling in trie_node method - Updated the error conversion helper function in ProofTaskTrieNodeProvider to directly wrap the ProviderError, enhancing clarity and maintainability. - This change simplifies the error handling logic within the trie_node method. --- crates/trie/parallel/src/proof_task.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/trie/parallel/src/proof_task.rs b/crates/trie/parallel/src/proof_task.rs index 5342fff1eb..231b0cb32b 100644 --- a/crates/trie/parallel/src/proof_task.rs +++ b/crates/trie/parallel/src/proof_task.rs @@ -1082,7 +1082,7 @@ impl TrieNodeProvider for ProofTaskTrieNodeProvider { fn trie_node(&self, path: &Nibbles) -> Result, SparseTrieError> { /// Helper to convert `ProviderError` to `SparseTrieError` fn provider_err_to_trie_err(e: ProviderError) -> SparseTrieError { - SparseTrieErrorKind::Other(Box::new(std::io::Error::other(e.to_string()))).into() + SparseTrieErrorKind::Other(Box::new(e)).into() } /// Helper to convert channel recv error to `SparseTrieError`