aboutsummaryrefslogtreecommitdiff
path: root/src/table/table.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2020-07-08 17:34:37 +0200
committerAlex Auvolat <alex@adnab.me>2020-07-08 17:34:37 +0200
commit44dba0e53c7bae0fa16bf48e6022faa95d1159aa (patch)
tree24bd564e6030f82c1ddad7602c12d12a71c0ed8a /src/table/table.rs
parent64a6eda0d2bb6aae6a6eef60032ab24ae3c37a88 (diff)
downloadgarage-44dba0e53c7bae0fa16bf48e6022faa95d1159aa.tar.gz
garage-44dba0e53c7bae0fa16bf48e6022faa95d1159aa.zip
cargo fmt
Diffstat (limited to 'src/table/table.rs')
-rw-r--r--src/table/table.rs23
1 files changed, 10 insertions, 13 deletions
diff --git a/src/table/table.rs b/src/table/table.rs
index 7a5caf4f..9d43a475 100644
--- a/src/table/table.rs
+++ b/src/table/table.rs
@@ -14,8 +14,8 @@ use garage_rpc::membership::{Ring, System};
use garage_rpc::rpc_client::*;
use garage_rpc::rpc_server::*;
-use crate::table_sync::*;
use crate::schema::*;
+use crate::table_sync::*;
const TABLE_RPC_TIMEOUT: Duration = Duration::from_secs(10);
@@ -48,7 +48,6 @@ pub enum TableRPC<F: TableSchema> {
impl<F: TableSchema> RpcMessage for TableRPC<F> {}
-
pub trait TableReplication: Send + Sync {
// See examples in table_sharded.rs and table_fullcopy.rs
// To understand various replication methods
@@ -456,15 +455,13 @@ where
ret
}
- fn decode_entry(bytes: &[u8]) -> Result<F::E, Error> {
- match rmp_serde::decode::from_read_ref::<_, F::E>(bytes) {
- Ok(x) => Ok(x),
- Err(e) => {
- match F::try_migrate(bytes) {
- Some(x) => Ok(x),
- None => Err(e.into()),
- }
- }
- }
- }
+ fn decode_entry(bytes: &[u8]) -> Result<F::E, Error> {
+ match rmp_serde::decode::from_read_ref::<_, F::E>(bytes) {
+ Ok(x) => Ok(x),
+ Err(e) => match F::try_migrate(bytes) {
+ Some(x) => Ok(x),
+ None => Err(e.into()),
+ },
+ }
+ }
}