diff options
author | Alex Auvolat <alex@adnab.me> | 2022-06-03 12:52:41 +0200 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2022-06-03 12:52:41 +0200 |
commit | 295bc2741f427106a00c9a965d3ae50bcb36107d (patch) | |
tree | ca02b22a8bbdc0c311ecd2fba4934b957b884875 | |
parent | 4bf706b170f149f54fd701576692cd5cd5bc9779 (diff) | |
download | garage-295bc2741f427106a00c9a965d3ae50bcb36107d.tar.gz garage-295bc2741f427106a00c9a965d3ae50bcb36107d.zip |
fix clipy lint
-rw-r--r-- | src/block/manager.rs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/block/manager.rs b/src/block/manager.rs index 53baede5..73dd453f 100644 --- a/src/block/manager.rs +++ b/src/block/manager.rs @@ -547,11 +547,10 @@ impl BlockManager { // - Ok(false) -> no block was processed, but we are ready for the next iteration // - Err(_) -> a Sled error occurred when reading/writing from resync_queue/resync_errors async fn resync_iter(&self, must_exit: &mut watch::Receiver<bool>) -> Result<bool, db::Error> { - let next = match self.resync_queue.first()? { - Some((k, v)) => Some((k.into_vec(), v.into_vec())), - None => None, - }; - + let next = self + .resync_queue + .first()? + .map(|(k, v)| (k.into_vec(), v.into_vec())); if let Some((time_bytes, hash_bytes)) = next { let time_msec = u64::from_be_bytes(time_bytes[0..8].try_into().unwrap()); let now = now_msec(); |