fix tests

This commit is contained in:
Robert Habermeier 2017-04-20 15:04:07 +02:00
parent 240c111ebb
commit a33b4cc73b
2 changed files with 2 additions and 2 deletions

View File

@ -910,7 +910,7 @@ mod tests {
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[0].0, &*key1);
assert_eq!(&*contents[0].1, b"cat");

View File

@ -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> {
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)?;
}