expect instead of unwrap

Co-authored-by: Philipp Gackstatter <PhilippGackstatter@users.noreply.github.com>
This commit is contained in:
Grzegorz Świrski 2025-04-16 09:34:52 +02:00 committed by Qyriad
parent 61782a5478
commit 29d24a697c

View file

@ -283,7 +283,7 @@ impl Iterator for SparseMerklePathIter<'_> {
self.next_depth = this_depth.get() - 1; self.next_depth = this_depth.get() - 1;
// `this_depth` is only ever decreasing, so it can't ever exceed `self.path.depth()`. // `this_depth` is only ever decreasing, so it can't ever exceed `self.path.depth()`.
let node = self.path.at_depth(this_depth).unwrap(); let node = self.path.at_depth(this_depth).expect("current depth should never exceed the path depth");
Some(node) Some(node)
} }