diff options
author | Alex Auvolat <alex@adnab.me> | 2023-01-03 14:44:47 +0100 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2023-01-03 14:44:47 +0100 |
commit | cdb2a591e9d393d24ab5c49bb905b0589b193299 (patch) | |
tree | 10c95206d0bd7b30c1fcd14ccc188be374cb1066 /src/table/sync.rs | |
parent | 582b0761790b7958a3ba10c4b549b466997d2dcd (diff) | |
download | garage-cdb2a591e9d393d24ab5c49bb905b0589b193299.tar.gz garage-cdb2a591e9d393d24ab5c49bb905b0589b193299.zip |
Refactor how things are migrated
Diffstat (limited to 'src/table/sync.rs')
-rw-r--r-- | src/table/sync.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/table/sync.rs b/src/table/sync.rs index d6d272ab..abc034f8 100644 --- a/src/table/sync.rs +++ b/src/table/sync.rs @@ -302,7 +302,7 @@ where ); return Ok(()); } - let root_ck_hash = hash_of::<MerkleNode>(&root_ck)?; + let root_ck_hash = hash_of_merkle_node(&root_ck)?; // Check if they have the same root checksum // If so, do nothing. @@ -468,7 +468,7 @@ where match message { SyncRpc::RootCkHash(range, h) => { let (_root_ck_key, root_ck) = self.get_root_ck(*range)?; - let hash = hash_of::<MerkleNode>(&root_ck)?; + let hash = hash_of_merkle_node(&root_ck)?; Ok(SyncRpc::RootCkDifferent(hash != *h)) } SyncRpc::GetNode(k) => { @@ -622,7 +622,7 @@ impl<F: TableSchema + 'static, R: TableReplication + 'static> Worker for SyncWor // ---- UTIL ---- -fn hash_of<T: Serialize>(x: &T) -> Result<Hash, Error> { +fn hash_of_merkle_node(x: &MerkleNode) -> Result<Hash, Error> { Ok(blake2sum(&rmp_to_vec_all_named(x)?[..])) } |