diff --git a/pingora-core/src/upstreams/peer.rs b/pingora-core/src/upstreams/peer.rs index e795987fe..fbac54eee 100644 --- a/pingora-core/src/upstreams/peer.rs +++ b/pingora-core/src/upstreams/peer.rs @@ -19,7 +19,6 @@ use pingora_error::{ ErrorType::{InternalError, SocketError}, OrErr, Result, }; -use std::{collections::BTreeMap, ops::Deref}; use std::fmt::{Display, Formatter, Result as FmtResult}; use std::hash::{Hash, Hasher}; use std::net::{IpAddr, SocketAddr as InetSocketAddr, ToSocketAddrs as ToInetSocketAddrs}; @@ -28,6 +27,7 @@ use std::os::unix::prelude::AsRawFd; use std::path::{Path, PathBuf}; use std::sync::Arc; use std::time::Duration; +use std::{collections::BTreeMap, ops::Deref}; use crate::protocols::l4::socket::SocketAddr; use crate::protocols::ConnFdReusable; @@ -68,9 +68,7 @@ impl PartialEq for Tracer { } } -impl Eq for Tracer { - -} +impl Eq for Tracer {} /// [`Peer`] defines the interface to communicate with the [`crate::connectors`] regarding where to /// connect to and how to connect to it. diff --git a/pingora-load-balancing/src/discovery.rs b/pingora-load-balancing/src/discovery.rs index d94091d9e..9f5a1f009 100644 --- a/pingora-load-balancing/src/discovery.rs +++ b/pingora-load-balancing/src/discovery.rs @@ -22,7 +22,7 @@ use std::hash::Hash; use std::io::Result as IoResult; use std::net::ToSocketAddrs; use std::{ - collections::{HashSet, HashMap}, + collections::{HashMap, HashSet}, sync::Arc, }; diff --git a/pingora-load-balancing/src/lib.rs b/pingora-load-balancing/src/lib.rs index f2f79c539..b5761332f 100644 --- a/pingora-load-balancing/src/lib.rs +++ b/pingora-load-balancing/src/lib.rs @@ -21,7 +21,7 @@ use futures::FutureExt; use pingora_core::protocols::l4::socket::SocketAddr; use pingora_error::{ErrorType, OrErr, Result}; use std::collections::hash_map::DefaultHasher; -use std::collections::{HashSet, HashMap}; +use std::collections::{HashMap, HashSet}; use std::hash::{Hash, Hasher}; use std::io::Result as IoResult; use std::net::ToSocketAddrs; @@ -147,11 +147,7 @@ where M: Eq + Hash, { /// Return true when the new is different from the current set of backends - fn do_update( - &self, - new_backends: HashSet>, - enablement: HashMap, - ) -> bool { + fn do_update(&self, new_backends: HashSet>, enablement: HashMap) -> bool { if (**self.backends.load()) != new_backends { let old_health = self.health.load(); let mut health = HashMap::with_capacity(new_backends.len()); @@ -328,9 +324,7 @@ where where A: ToSocketAddrs, { - let iter = iter.into_iter().map(|a| { - (a, M::default()) - }); + let iter = iter.into_iter().map(|a| (a, M::default())); let discovery = discovery::Static::::try_from_iter(iter)?; let backends = Backends::::new(discovery); let lb = Self::from_backends(backends);