diff --git a/src/proof/proof_nodes.rs b/src/proof/proof_nodes.rs index 81a306c..d1f5f4b 100644 --- a/src/proof/proof_nodes.rs +++ b/src/proof/proof_nodes.rs @@ -23,6 +23,12 @@ impl FromIterator<(Nibbles, Bytes)> for ProofNodes { } } +impl Extend<(Nibbles, Bytes)> for ProofNodes { + fn extend>(&mut self, iter: T) { + self.0.extend(iter); + } +} + impl ProofNodes { /// Return iterator over proof nodes that match the target. pub fn matching_nodes_iter<'a>( @@ -67,4 +73,9 @@ impl ProofNodes { pub fn into_inner(self) -> HashMap { self.0 } + + /// Extends with the elements of another `ProofNodes`. + pub fn extend_from(&mut self, other: Self) { + self.extend(other.0); + } }