fix tests
This commit is contained in:
parent
240c111ebb
commit
a33b4cc73b
@ -910,7 +910,7 @@ mod tests {
|
|||||||
|
|
||||||
assert_eq!(&*db.get(None, &key1).unwrap().unwrap(), b"cat");
|
assert_eq!(&*db.get(None, &key1).unwrap().unwrap(), b"cat");
|
||||||
|
|
||||||
let contents: Vec<_> = db.iter(None).collect();
|
let contents: Vec<_> = db.iter(None).into_iter().flat_map(|inner| inner).collect();
|
||||||
assert_eq!(contents.len(), 2);
|
assert_eq!(contents.len(), 2);
|
||||||
assert_eq!(&*contents[0].0, &*key1);
|
assert_eq!(&*contents[0].0, &*key1);
|
||||||
assert_eq!(&*contents[0].1, b"cat");
|
assert_eq!(&*contents[0].1, b"cat");
|
||||||
|
@ -94,7 +94,7 @@ impl Migration for AddsColumn {
|
|||||||
fn migrate(&mut self, source: Arc<Database>, config: &Config, dest: &mut Database, col: Option<u32>) -> Result<(), Error> {
|
fn migrate(&mut self, source: Arc<Database>, config: &Config, dest: &mut Database, col: Option<u32>) -> Result<(), Error> {
|
||||||
let mut batch = Batch::new(config, col);
|
let mut batch = Batch::new(config, col);
|
||||||
|
|
||||||
for (key, value) in source.iter(col) {
|
for (key, value) in source.iter(col).into_iter().flat_map(|inner| inner) {
|
||||||
batch.insert(key.to_vec(), value.to_vec(), dest)?;
|
batch.insert(key.to_vec(), value.to_vec(), dest)?;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user