From 3de4649f58d02a7bec29072762e6e51ffbaf4593 Mon Sep 17 00:00:00 2001 From: Quantum Explorer Date: Tue, 20 Aug 2024 16:04:09 +0700 Subject: [PATCH] fix --- merk/src/proofs/query/mod.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/merk/src/proofs/query/mod.rs b/merk/src/proofs/query/mod.rs index de66403a..8bbb07e9 100644 --- a/merk/src/proofs/query/mod.rs +++ b/merk/src/proofs/query/mod.rs @@ -86,10 +86,11 @@ impl SubqueryBranch { return None; } let subquery_path_depth = self.subquery_path.as_ref().map_or(Some(0), |path| { - if path.len() > u16::MAX as usize { + let path_len = path.len(); + if path_len > u16::MAX as usize { None } else { - Some(path.len() as u16) + Some(path_len as u16) } })?; let subquery_depth = self.subquery.as_ref().map_or(Some(0), |query| {