summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSanto Cariotti <santo@dcariotti.me>2025-09-24 19:22:31 +0000
committerSanto Cariotti <santo@dcariotti.me>2025-09-24 19:22:31 +0000
commitd82144f5e9b72d89370532fb98a0a43e003b5c00 (patch)
tree903c7724ba7a9e9bf15a47be754250f55b6195c0 /src
parent95ca7f2c3bcee434d4c7fba810117e305925e4d5 (diff)
`build()` now uses the term "leaves" instead of "nodes"
Diffstat (limited to 'src')
-rw-r--r--src/merkletree.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/merkletree.rs b/src/merkletree.rs
index 53e6cdc..ca2f37b 100644
--- a/src/merkletree.rs
+++ b/src/merkletree.rs
@@ -67,12 +67,11 @@ impl MerkleTree {
}
/// Constructs the internal nodes of the tree from the leaves upward and computes the root.
- fn build<H>(hasher: H, nodes: Vec<Node>) -> Self
+ fn build<H>(hasher: H, leaves: Vec<Node>) -> Self
where
H: Hasher + 'static + std::marker::Sync,
{
- let leaves = nodes.clone();
- let mut current_level = nodes;
+ let mut current_level = leaves.clone();
let mut next_level = Vec::with_capacity((current_level.len() + 1) / 2);
let mut height = 0;