Hide cookies in ServerConfig Debug impl
This commit is contained in:
parent
1ea5ede442
commit
0c7e8c1dff
1 changed files with 21 additions and 1 deletions
|
|
@ -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, "<hidden>")
|
||||
}
|
||||
}
|
||||
|
||||
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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue