pub fn finalize_root(&mut self, hash: &H) -> Option<V> {
		if let Some(position) = self.roots.iter().position(|node| node.hash == *hash) {
			let node = self.roots.swap_remove(position);
			self.roots = node.children;
			self.best_finalized_number = Some(node.number);
			return Some(node.data);
		}

		None
	}
/// Finalize a root in the tree and return it, return `None` in case no root
/// with the given hash exists. All other roots are pruned, and the children
/// of the finalized node become the new roots.
Finalize a root in the tree and return it, return `None` in case no root
with the given hash exists. All other roots are pruned, and the children
of the finalized node become the new roots.
Finalize a root in the tree and return it return ` None ` in case no root with the given hash exists . All other roots are pruned and the children of the finalized node become the new roots .
pub fn finalize_root(&mut self, hash: &H) -> Option<V> {
		if let Some(position) = self.roots.iter().position(|node| node.hash == *hash) {
			let node = self.roots.swap_remove(position);
			self.roots = node.children;
			self.best_finalized_number = Some(node.number);
			return Some(node.data);
		}
		None
	}
pub fn finalize_root ( & mut self , hash : & H ) -> Option < V > { if let Some ( position ) = self . roots . iter ( ) . position ( | node | node . hash == * hash ) { let node = self . roots . swap_remove ( position ) ; self . roots = node . children ; self . best_finalized_number = Some ( node . number ) ; return Some ( node . data ) ; } None }
Finalize a root in the tree and return it, return `None` in case no root
with the given hash exists.
Finalize a root in the tree and return it return ` None ` in case no root with the given hash exists .
&mut self
hash
&H
&mut self
hash
&H