aboutsummaryrefslogtreecommitdiff
path: root/src/block/manager.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2022-06-03 11:14:24 +0200
committerAlex Auvolat <alex@adnab.me>2022-06-03 11:14:24 +0200
commitcc0d984118e345c72341ff12d74b1c35deb20ae8 (patch)
tree04a3b045302987f673fd31e7c21b110ea824f93f /src/block/manager.rs
parentf25309e58f839d1fad6b094cd33d7f36b5c3e2e0 (diff)
downloadgarage-cc0d984118e345c72341ff12d74b1c35deb20ae8.tar.gz
garage-cc0d984118e345c72341ff12d74b1c35deb20ae8.zip
Fix most clippy lints
Diffstat (limited to 'src/block/manager.rs')
-rw-r--r--src/block/manager.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/block/manager.rs b/src/block/manager.rs
index de9b08c2..fbca74e2 100644
--- a/src/block/manager.rs
+++ b/src/block/manager.rs
@@ -56,6 +56,8 @@ const RESYNC_RETRY_DELAY_MAX_BACKOFF_POWER: u64 = 6;
// to delete the block locally.
pub(crate) const BLOCK_GC_DELAY: Duration = Duration::from_secs(600);
+type OptKVPair = Option<(Vec<u8>, Vec<u8>)>;
+
/// RPC messages used to share blocks of data between nodes
#[derive(Debug, Serialize, Deserialize)]
pub enum BlockRpc {
@@ -640,7 +642,7 @@ impl BlockManager {
}
}
- fn resync_get_next(&self) -> Result<Option<(Vec<u8>, Vec<u8>)>, db::Error> {
+ fn resync_get_next(&self) -> Result<OptKVPair, db::Error> {
match self.resync_queue.iter()?.next() {
None => Ok(None),
Some(v) => {
@@ -970,7 +972,7 @@ impl ErrorCounter {
}
}
- fn decode<'a>(data: db::Value<'a>) -> Self {
+ fn decode(data: db::Value<'_>) -> Self {
Self {
errors: u64::from_be_bytes(data[0..8].try_into().unwrap()),
last_try: u64::from_be_bytes(data[8..16].try_into().unwrap()),