fn into_hash_tree(mut hash_trees: VecDeque<HashTree>) -> HashTree {
    if hash_trees.is_empty() {
        return HashTree::Leaf {
            digest: empty_subtree_hash(),
        };
    }

    let mut combined_trees = VecDeque::with_capacity((hash_trees.len() + 1) / 2);
    while hash_trees.len() != 1 {
        while let Some(left) = hash_trees.pop_front() {
            match hash_trees.pop_front() {
                Some(right) => combined_trees.push_back(into_fork(left, right)),
                None => combined_trees.push_back(left),
            }
        }
        std::mem::swap(&mut hash_trees, &mut combined_trees);
    }
    hash_trees
        .pop_front()
        .expect("Missing element from hash_trees")
}
// Wraps the given hash_trees into a single HashTree, maintaining
// the order of the subtrees.
Wraps the given hash_trees into a single HashTree, maintaining
the order of the subtrees.
Wraps the given hash_trees into a single HashTree maintaining the order of the subtrees .
fn into_hash_tree(mut hash_trees: VecDeque<HashTree>) -> HashTree {
    if hash_trees.is_empty() {
        return HashTree::Leaf {
            digest: empty_subtree_hash(),
        };
    }
    let mut combined_trees = VecDeque::with_capacity((hash_trees.len() + 1) / 2);
    while hash_trees.len() != 1 {
        while let Some(left) = hash_trees.pop_front() {
            match hash_trees.pop_front() {
                Some(right) => combined_trees.push_back(into_fork(left, right)),
                None => combined_trees.push_back(left),
            }
        }
        std::mem::swap(&mut hash_trees, &mut combined_trees);
    }
    hash_trees
        .pop_front()
        .expect("Missing element from hash_trees")
}
fn into_hash_tree ( mut hash_trees : VecDeque < HashTree > ) -> HashTree { if hash_trees . is_empty ( ) { return HashTree :: Leaf { digest : empty_subtree_hash ( ) , } ; } let mut combined_trees = VecDeque :: with_capacity ( ( hash_trees . len ( ) + 1 ) / 2 ) ; while hash_trees . len ( ) != 1 { while let Some ( left ) = hash_trees . pop_front ( ) { match hash_trees . pop_front ( ) { Some ( right ) => combined_trees . push_back ( into_fork ( left , right ) ) , None => combined_trees . push_back ( left ) , } } std :: mem :: swap ( & mut hash_trees , & mut combined_trees ) ; } hash_trees . pop_front ( ) . expect ( " " ) }
Wraps the given hash_trees into a single HashTree, maintaining
the order of the subtrees.
Wraps the given hash_trees into a single HashTree maintaining the order of the subtrees .
hash_trees
VecDeque<HashTree>
hash_trees
VecDeque<HashTree>