From b04716d40d1e292c950b0e33102ba74a85336dc0 Mon Sep 17 00:00:00 2001 From: Anatoly Yakovenko Date: Wed, 16 May 2018 23:11:51 -0700 Subject: [PATCH] fmt --- src/crdt.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/crdt.rs b/src/crdt.rs index 053b4491c6..0bde81dc49 100644 --- a/src/crdt.rs +++ b/src/crdt.rs @@ -21,6 +21,7 @@ use rayon::prelude::*; use result::{Error, Result}; use ring::rand::{SecureRandom, SystemRandom}; use signature::{PublicKey, Signature}; +use std; use std::collections::HashMap; use std::io::Cursor; use std::net::{SocketAddr, UdpSocket}; @@ -28,7 +29,6 @@ use std::sync::atomic::{AtomicBool, Ordering}; use std::sync::{Arc, RwLock}; use std::thread::{sleep, spawn, JoinHandle}; use std::time::Duration; -use std; /// Structure to be replicated by the network #[derive(Serialize, Deserialize, Clone)] @@ -298,10 +298,12 @@ impl Crdt { // max number of nodes that we could be converged to pub fn convergence(&self) -> u64 { - let min = self.remote.values().fold(std::u64::MAX, |a,b| std::cmp::min(a, *b)); + let min = self.remote + .values() + .fold(std::u64::MAX, |a, b| std::cmp::min(a, *b)); std::cmp::min(min, self.remote.values().len() as u64 + 1) } - + fn random() -> u64 { let rnd = SystemRandom::new(); let mut buf = [0u8; 8];