message: move Debug from Inner to Config, use Formatter::debug_struct
diff: @@ -69,45 +69,6 @@ pub(crate) struct Inner {
  pub(crate) target_session_attrs: TargetSessionAttrs,
  }
  -// Omit password from debug output
  -impl fmt::Debug for Inner {
  - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
  - write!(
  - f,
  - "Inner {{ \
  - user: {:?}, \
  - password: {}, \
  - dbname: {:?}, \
  - options: {:?}, \
  - application_name: {:?}, \
  - ssl_mode: {:?}, \
  - host: {:?}, \
  - port: {:?}, \
  - connect_timeout: {:?}, \
  - keepalives: {:?}, \
  - keepalives_idle: {:?}, \
  - target_session_attrs: {:?} \
  - }}",
  - self.user,
  - if self.password.is_some() {
  - "Some(_)"
  - } else {
  - "None"
  - },
  - self.dbname,
  - self.options,
  - self.application_name,
  - self.ssl_mode,
  - self.host,
  - self.port,
  - self.connect_timeout,
  - self.keepalives,
  - self.keepalives_idle,
  - self.target_session_attrs
  - )
  - }
  -}
  -
  /// Connection configuration.
  ///
  /// Configuration can be parsed from libpq-style connection strings. These strings come in two formats:
  @@ -181,7 +142,7 @@ impl fmt::Debug for Inner {
  /// ```not_rust
  /// postgresql:///mydb?user=user&host=/var/lib/postgresql
  /// ```
  -#[derive(Debug, Clone, PartialEq)]
  +#[derive(Clone, PartialEq)]
  pub struct Config(pub(crate) Arc<Inner>);
  impl Default for Config {
  @@ -453,6 +414,33 @@ impl FromStr for Config {
  }
  }
  +// Omit password from debug output
  +impl fmt::Debug for Config {
  + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
  + struct Redaction {}
  + impl fmt::Debug for Redaction {
  + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
  + write!(f, "_")
  + }
  + }
  +
  + f.debug_struct("Config")
  + .field("user", &self.0.user)
  + .field("password", &self.0.password.as_ref().map(|_| Redaction {}))
  + .field("dbname", &self.0.dbname)
  + .field("options", &self.0.options)
  + .field("application_name", &self.0.application_name)
  + .field("ssl_mode", &self.0.ssl_mode)
  + .field("host", &self.0.host)
  + .field("port", &self.0.port)
  + .field("connect_timeout", &self.0.connect_timeout)
  + .field("keepalives", &self.0.keepalives)
  + .field("keepalives_idle", &self.0.keepalives_idle)
  + .field("target_session_attrs", &self.0.target_session_attrs)
  + .finish()
  + }
  +}
  +
  #[derive(Debug)]
  struct UnknownOption(String);
  