From c439cb11a908ee5405ed0a3a721e9c8c0e299ad2 Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Thu, 2 Jun 2022 23:14:10 +0200 Subject: Sqlite iter with unsafe code --- src/model/migrate.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/model') diff --git a/src/model/migrate.rs b/src/model/migrate.rs index 1f063265..25acb4b0 100644 --- a/src/model/migrate.rs +++ b/src/model/migrate.rs @@ -25,11 +25,15 @@ impl Migrate { .open_tree("bucket:table") .map_err(GarageError::from)?; + let mut old_buckets = vec![]; for res in tree.iter().map_err(GarageError::from)? { let (_k, v) = res.map_err(GarageError::from)?; let bucket = rmp_serde::decode::from_read_ref::<_, old_bucket::Bucket>(&v[..]) .map_err(GarageError::from)?; + old_buckets.push(bucket); + } + for bucket in old_buckets { if let old_bucket::BucketState::Present(p) = bucket.state.get() { self.migrate_buckets050_do_bucket(&bucket, p).await?; } -- cgit v1.2.3