pub fn build_layer<'a>(nodes: Vec<Node>, crypto: &Provider) -> Result<Vec<Node>, Error> {
    let mut layer = Vec::<Node>::with_capacity(&nodes.len() / 2);
    let mut nodes_iter = nodes.into_iter();
    while let (Some(left), Some(right)) = (nodes_iter.next(), nodes_iter.next()) {
        layer.push(hash_branch(left, right, &crypto).unwrap());
    }
    Ok(layer)
}
/// Builds one layer of branch nodes from a layer of child nodes.
Builds one layer of branch nodes from a layer of child nodes.
Builds one layer of branch nodes from a layer of child nodes .
pub fn build_layer<'a>(nodes: Vec<Node>, crypto: &Provider) -> Result<Vec<Node>, Error> {
    let mut layer = Vec::<Node>::with_capacity(&nodes.len() / 2);
    let mut nodes_iter = nodes.into_iter();
    while let (Some(left), Some(right)) = (nodes_iter.next(), nodes_iter.next()) {
        layer.push(hash_branch(left, right, &crypto).unwrap());
    }
    Ok(layer)
}
pub fn build_layer < ' a > ( nodes : Vec < Node > , crypto : & Provider ) -> Result < Vec < Node > , Error > { let mut layer = Vec :: < Node > :: with_capacity ( & nodes . len ( ) / 2 ) ; let mut nodes_iter = nodes . into_iter ( ) ; while let ( Some ( left ) , Some ( right ) ) = ( nodes_iter . next ( ) , nodes_iter . next ( ) ) { layer . push ( hash_branch ( left , right , & crypto ) . unwrap ( ) ) ; } Ok ( layer ) }
Builds one layer of branch nodes from a layer of child nodes.
Builds one layer of branch nodes from a layer of child nodes .
nodes
Vec<Node>
crypto
&Provider
nodes
Vec<Node>
crypto
&Provider