diff --git a/src/config.rs b/src/config.rs index 669bbe9..d6d9538 100644 --- a/src/config.rs +++ b/src/config.rs @@ -45,22 +45,16 @@ pub enum Upstream { Proxy(ProxyToUpstream), } -#[derive(Debug)] +#[derive(Debug, Default)] struct Addr(Mutex); -impl Default for Addr { - fn default() -> Self { - Self(Default::default()) - } -} - impl Clone for Addr { fn clone(&self) -> Self { tokio::task::block_in_place(|| Self(Mutex::new(self.0.blocking_lock().clone()))) } } -#[derive(Debug, Clone, Deserialize)] +#[derive(Debug, Clone, Deserialize, Default)] pub struct ProxyToUpstream { pub name: String, pub addr: String, @@ -76,17 +70,6 @@ impl ProxyToUpstream { } } -impl Default for ProxyToUpstream { - fn default() -> Self { - Self { - name: Default::default(), - addr: Default::default(), - protocol: Default::default(), - addresses: Default::default(), - } - } -} - #[derive(Debug)] pub enum ConfigError { IO(IOError),