From e405f58ef527a2cd4aa2164a7bc1c14fcc9d7fb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Grzegorz=20=C5=9Awirski?= Date: Sat, 3 May 2025 20:54:00 +0200 Subject: [PATCH] document the direction of iteration --- miden-crypto/src/merkle/sparse_path.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/miden-crypto/src/merkle/sparse_path.rs b/miden-crypto/src/merkle/sparse_path.rs index fa064bb..8d3ed95 100644 --- a/miden-crypto/src/merkle/sparse_path.rs +++ b/miden-crypto/src/merkle/sparse_path.rs @@ -103,6 +103,7 @@ impl SparseMerklePath { // ============================================================================================ /// Constructs a borrowing iterator over the nodes in this path. + /// Starts from the leaf and iterates toward the root (excluding root). pub fn iter(&self) -> impl ExactSizeIterator { self.into_iter() } @@ -196,7 +197,8 @@ impl From for Vec { // ITERATORS // ================================================================================================ -/// Iterator for [`SparseMerklePath`]. +/// Iterator for [`SparseMerklePath`]. Starts from the leaf and iterates toward the root (excluding +/// root). pub struct SparseMerklePathIter<'p> { /// The "inner" value we're iterating over. path: Cow<'p, SparseMerklePath>,