// Returns a HashTree::HashNode that contains a HashLeaf with the given data.
Returns a HashTree::HashNode that contains a HashLeaf with the given data.
Returns a HashTree :: HashNode that contains a HashLeaf with the given data .
fn hash_node_with_leaf(label: &Label, leaf_data: &str) -> HashTree {
    let hash_leaf = HashTree::Leaf {
        digest: leaf_digest(leaf_data),
    };
    HashTree::Node {
        digest: node_digest(label, &hash_leaf.digest().0),
        label: label.clone(),
        hash_tree: Box::new(hash_leaf),
    }
}
fn hash_node_with_leaf ( label : & Label , leaf_data : & str ) -> HashTree { let hash_leaf = HashTree :: Leaf { digest : leaf_digest ( leaf_data ) , } ; HashTree :: Node { digest : node_digest ( label , & hash_leaf . digest ( ) . 0 ) , label : label . clone ( ) , hash_tree : Box :: new ( hash_leaf ) , } }
Returns a HashTree::HashNode that contains a HashLeaf with the given data.
Returns a HashTree :: HashNode that contains a HashLeaf with the given data .
label
&Label
leaf_data
&str