fix defaulting names

This commit is contained in:
Jonathan de Jong 2021-12-15 17:46:42 +01:00
parent e20e99493e
commit 87d20a7857
2 changed files with 4 additions and 1 deletions

View file

@ -62,7 +62,7 @@ impl Database for RocksDB {
}
fn names<'a>(&'a self) -> Vec<Vec<u8>> {
self.old_cfs.iter().map(|v| v.as_bytes().to_vec()).collect()
self.old_cfs.iter().filter(|&v| &*v != "default").map(|v| v.as_bytes().to_vec()).collect()
}
}

View file

@ -15,11 +15,14 @@ impl SledDB {
}
}
const SLED_DEFAULT: &[u8] = "__sled__default".as_bytes();
impl Database for SledDB {
fn names<'a>(&'a self) -> Vec<Vec<u8>> {
self.0
.tree_names()
.into_iter()
.filter(|v| v != SLED_DEFAULT)
.map(|v| v.to_vec())
.collect_vec()
}