assert that sled maps are collision free

This commit is contained in:
Jane Lusby 2020-11-04 17:31:42 -08:00
parent 785fc30481
commit 0cda9039bb
1 changed files with 4 additions and 1 deletions

View File

@ -243,7 +243,10 @@ impl SledSerialize for sled::transaction::TransactionalTree {
{ {
let key_bytes = key.into_ivec(); let key_bytes = key.into_ivec();
let value_bytes = value.into_ivec(); let value_bytes = value.into_ivec();
self.insert(key_bytes, value_bytes)?; let previous = self.insert(key_bytes, value_bytes)?;
assert!(previous.is_none());
Ok(()) Ok(())
} }
} }