document the direction of iteration
This commit is contained in:
parent
d3e70cf58b
commit
e405f58ef5
1 changed files with 3 additions and 1 deletions
|
@ -103,6 +103,7 @@ impl SparseMerklePath {
|
||||||
// ============================================================================================
|
// ============================================================================================
|
||||||
|
|
||||||
/// Constructs a borrowing iterator over the nodes in this path.
|
/// 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<Item = RpoDigest> {
|
pub fn iter(&self) -> impl ExactSizeIterator<Item = RpoDigest> {
|
||||||
self.into_iter()
|
self.into_iter()
|
||||||
}
|
}
|
||||||
|
@ -196,7 +197,8 @@ impl From<SparseMerklePath> for Vec<RpoDigest> {
|
||||||
// ITERATORS
|
// ITERATORS
|
||||||
// ================================================================================================
|
// ================================================================================================
|
||||||
|
|
||||||
/// Iterator for [`SparseMerklePath`].
|
/// Iterator for [`SparseMerklePath`]. Starts from the leaf and iterates toward the root (excluding
|
||||||
|
/// root).
|
||||||
pub struct SparseMerklePathIter<'p> {
|
pub struct SparseMerklePathIter<'p> {
|
||||||
/// The "inner" value we're iterating over.
|
/// The "inner" value we're iterating over.
|
||||||
path: Cow<'p, SparseMerklePath>,
|
path: Cow<'p, SparseMerklePath>,
|
||||||
|
|
Loading…
Add table
Reference in a new issue