diff --git a/src/bot/instance.rs b/src/bot/instance.rs index b051cab..047260b 100644 --- a/src/bot/instance.rs +++ b/src/bot/instance.rs @@ -2,6 +2,7 @@ //! //! See [`Instance`] for more details. +use std::fmt; use std::str::FromStr; use std::sync::{Arc, Mutex}; use std::time::Duration; @@ -18,7 +19,7 @@ use crate::conn::{self, Conn, ConnTx, State}; /// Settings that are usually shared between all instances connecting to a /// specific server. -#[derive(Debug, Clone)] +#[derive(Clone)] pub struct ServerConfig { /// How long to wait for the server until an operation is considered timed /// out. @@ -74,6 +75,25 @@ impl Default for ServerConfig { } } +struct Hidden; + +impl fmt::Debug for Hidden { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + write!(f, "") + } +} + +impl fmt::Debug for ServerConfig { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + f.debug_struct("ServerConfig") + .field("timeout", &self.timeout) + .field("reconnect_delay", &self.reconnect_delay) + .field("domain", &self.domain) + .field("cookies", &Hidden) + .finish() + } +} + /// Settings that are usually specific to a single instance. #[derive(Debug, Clone)] pub struct InstanceConfig {