mirror of https://github.com/fafhrd91/actix-net
chore(*): fix clippy warnings (#813)
This commit is contained in:
parent
22f98ec136
commit
c347906c78
|
|
@ -172,7 +172,7 @@ impl Arbiter {
|
|||
let system_id = sys.id();
|
||||
let arb_id = COUNT.fetch_add(1, Ordering::Relaxed);
|
||||
|
||||
let name = format!("actix-rt|system:{}|arbiter:{}", system_id, arb_id);
|
||||
let name = format!("actix-rt|system:{system_id}|arbiter:{arb_id}");
|
||||
let (tx, rx) = mpsc::unbounded_channel();
|
||||
|
||||
let (ready_tx, ready_rx) = std::sync::mpsc::channel::<()>();
|
||||
|
|
|
|||
|
|
@ -224,9 +224,10 @@ impl WorkerService {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
|
||||
enum WorkerServiceStatus {
|
||||
Available,
|
||||
#[default]
|
||||
Unavailable,
|
||||
Failed,
|
||||
Restarting,
|
||||
|
|
@ -234,12 +235,6 @@ enum WorkerServiceStatus {
|
|||
Stopped,
|
||||
}
|
||||
|
||||
impl Default for WorkerServiceStatus {
|
||||
fn default() -> Self {
|
||||
Self::Unavailable
|
||||
}
|
||||
}
|
||||
|
||||
/// Config for worker behavior passed down from server builder.
|
||||
#[derive(Debug, Clone, Copy)]
|
||||
pub(crate) struct ServerWorkerConfig {
|
||||
|
|
@ -543,8 +538,10 @@ impl ServerWorker {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Default)]
|
||||
enum WorkerState {
|
||||
Available,
|
||||
#[default]
|
||||
Unavailable,
|
||||
Restarting(Restart),
|
||||
Shutdown(Shutdown),
|
||||
|
|
@ -568,12 +565,6 @@ struct Shutdown {
|
|||
tx: oneshot::Sender<bool>,
|
||||
}
|
||||
|
||||
impl Default for WorkerState {
|
||||
fn default() -> Self {
|
||||
Self::Unavailable
|
||||
}
|
||||
}
|
||||
|
||||
impl Drop for ServerWorker {
|
||||
fn drop(&mut self) {
|
||||
Arbiter::try_current().as_ref().map(ArbiterHandle::stop);
|
||||
|
|
|
|||
|
|
@ -4,8 +4,9 @@ use std::{
|
|||
net::SocketAddr,
|
||||
};
|
||||
|
||||
#[derive(Debug, Clone, Eq, PartialEq, Hash)]
|
||||
#[derive(Debug, Clone, Eq, PartialEq, Hash, Default)]
|
||||
pub(crate) enum ConnectAddrs {
|
||||
#[default]
|
||||
None,
|
||||
One(SocketAddr),
|
||||
// TODO: consider using smallvec
|
||||
|
|
@ -22,12 +23,6 @@ impl ConnectAddrs {
|
|||
}
|
||||
}
|
||||
|
||||
impl Default for ConnectAddrs {
|
||||
fn default() -> Self {
|
||||
Self::None
|
||||
}
|
||||
}
|
||||
|
||||
impl From<Option<SocketAddr>> for ConnectAddrs {
|
||||
fn from(addr: Option<SocketAddr>) -> Self {
|
||||
match addr {
|
||||
|
|
|
|||
|
|
@ -49,23 +49,18 @@ impl<R: Host> ServiceFactory<ConnectInfo<R>> for Resolver {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Clone)]
|
||||
#[derive(Clone, Default)]
|
||||
enum ResolverKind {
|
||||
/// Built-in DNS resolver.
|
||||
///
|
||||
/// See [`std::net::ToSocketAddrs`] trait.
|
||||
#[default]
|
||||
Default,
|
||||
|
||||
/// Custom, user-provided DNS resolver.
|
||||
Custom(Rc<dyn Resolve>),
|
||||
}
|
||||
|
||||
impl Default for ResolverKind {
|
||||
fn default() -> Self {
|
||||
Self::Default
|
||||
}
|
||||
}
|
||||
|
||||
/// DNS resolver service.
|
||||
#[derive(Clone, Default)]
|
||||
pub struct ResolverService {
|
||||
|
|
|
|||
Loading…
Reference in New Issue