pub(crate) fn insert_into_memory_db<H, I>(mdb: &mut MemoryDB<H>, input: I) -> Option<H::Out>
	where
		H: Hasher,
		H::Out: HeapSizeOf,
		I: IntoIterator<Item=(Vec<u8>, Vec<u8>)>,
{
	let mut root = <H as Hasher>::Out::default();
	{
		let mut trie = TrieDBMut::<H>::new(mdb, &mut root);
		for (key, value) in input {
			if let Err(e) = trie.insert(&key, &value) {
				warn!(target: "trie", "Failed to write to trie: {}", e);
				return None;
			}
		}
	}

	Some(root)
}
/// Insert input pairs into memory db.
Insert input pairs into memory db.
Insert input pairs into memory db .
pub(crate) fn insert_into_memory_db<H, I>(mdb: &mut MemoryDB<H>, input: I) -> Option<H::Out>
	where
		H: Hasher,
		H::Out: HeapSizeOf,
		I: IntoIterator<Item=(Vec<u8>, Vec<u8>)>,
{
	let mut root = <H as Hasher>::Out::default();
	{
		let mut trie = TrieDBMut::<H>::new(mdb, &mut root);
		for (key, value) in input {
			if let Err(e) = trie.insert(&key, &value) {
				warn!(target: "trie", "Failed to write to trie: {}", e);
				return None;
			}
		}
	}
	Some(root)
}
pub ( crate ) fn insert_into_memory_db < H , I > ( mdb : & mut MemoryDB < H > , input : I ) -> Option < H :: Out > where H : Hasher , H :: Out : HeapSizeOf , I : IntoIterator < Item = ( Vec < u8 > , Vec < u8 > ) > , { let mut root = < H as Hasher > :: Out :: default ( ) ; { let mut trie = TrieDBMut :: < H > :: new ( mdb , & mut root ) ; for ( key , value ) in input { if let Err ( e ) = trie . insert ( & key , & value ) { warn ! ( target " " " " e ) ; return None ; } } } Some ( root ) }
Insert input pairs into memory db.
Insert input pairs into memory db .
mdb
&mut MemoryDB<H>
input
I
mdb
&mut MemoryDB<H>
input
I