aboutsummaryrefslogtreecommitdiff
path: root/src/rpc/ring.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2021-02-23 18:46:25 +0100
committerAlex Auvolat <alex@adnab.me>2021-02-23 18:46:25 +0100
commit40763fd749f36fe612f20f79ff7cac51252cc128 (patch)
treec43e3a8190a3323a93a7253c8095e33add817a7f /src/rpc/ring.rs
parent6e6f7e8555ad488a8b4d67ba640ddad933aa2654 (diff)
downloadgarage-40763fd749f36fe612f20f79ff7cac51252cc128.tar.gz
garage-40763fd749f36fe612f20f79ff7cac51252cc128.zip
Cargo fmt
Diffstat (limited to 'src/rpc/ring.rs')
-rw-r--r--src/rpc/ring.rs11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/rpc/ring.rs b/src/rpc/ring.rs
index 1df0bb41..5ca43ac9 100644
--- a/src/rpc/ring.rs
+++ b/src/rpc/ring.rs
@@ -4,7 +4,6 @@ use serde::{Deserialize, Serialize};
use garage_util::data::*;
-
#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct NetworkConfig {
pub members: HashMap<UUID, NetworkConfigEntry>,
@@ -13,7 +12,7 @@ pub struct NetworkConfig {
impl NetworkConfig {
pub(crate) fn new() -> Self {
- Self{
+ Self {
members: HashMap::new(),
version: 0,
}
@@ -27,7 +26,6 @@ pub struct NetworkConfigEntry {
pub tag: String,
}
-
#[derive(Clone)]
pub struct Ring {
pub config: NetworkConfig,
@@ -53,7 +51,12 @@ impl Ring {
if !datacenters.contains(datacenter) {
datacenters.push(datacenter.to_string());
}
- let datacenter_idx = datacenters.iter().enumerate().find(|(_, dc)| *dc == datacenter).unwrap().0;
+ let datacenter_idx = datacenters
+ .iter()
+ .enumerate()
+ .find(|(_, dc)| *dc == datacenter)
+ .unwrap()
+ .0;
for i in 0..config.n_tokens {
let location = sha256sum(format!("{} {}", hex::encode(&id), i).as_bytes());