Skip to content

Commit

Permalink
Cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesmunns committed Jun 26, 2024
1 parent bdbabef commit 12ca93c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 14 deletions.
6 changes: 2 additions & 4 deletions pingora-core/src/upstreams/peer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand All @@ -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;
Expand Down Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion pingora-load-balancing/src/discovery.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};

Expand Down
12 changes: 3 additions & 9 deletions pingora-load-balancing/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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<Backend<M>>,
enablement: HashMap<u64, bool>,
) -> bool {
fn do_update(&self, new_backends: HashSet<Backend<M>>, enablement: HashMap<u64, bool>) -> bool {
if (**self.backends.load()) != new_backends {
let old_health = self.health.load();
let mut health = HashMap::with_capacity(new_backends.len());
Expand Down Expand Up @@ -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::<M>::try_from_iter(iter)?;
let backends = Backends::<M>::new(discovery);
let lb = Self::from_backends(backends);
Expand Down

0 comments on commit 12ca93c

Please sign in to comment.