client-api: Don't include token in Debug-format of login::Token

This commit is contained in:
Jonas Platte 2022-10-17 15:14:36 +02:00
parent d14cd4e697
commit 88a6e9995d
No known key found for this signature in database
GPG Key ID: AAA7A61F696C3E0C

View File

@ -268,8 +268,9 @@ pub mod v3 {
}
/// A token to supply as authentication.
#[derive(Clone, Debug, Incoming, Serialize)]
#[derive(Clone, Incoming, Serialize)]
#[cfg_attr(not(feature = "unstable-exhaustive-types"), non_exhaustive)]
#[incoming_derive(!Debug)]
#[serde(tag = "type", rename = "m.login.token")]
pub struct Token<'a> {
/// The token.
@ -290,6 +291,18 @@ pub mod v3 {
}
}
impl<'a> fmt::Debug for Token<'a> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.debug_struct("Token").finish_non_exhaustive()
}
}
impl fmt::Debug for IncomingToken {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.debug_struct("IncomingToken").finish_non_exhaustive()
}
}
/// An identifier to supply for Application Service authentication.
#[derive(Clone, Debug, Incoming, Serialize)]
#[cfg_attr(not(feature = "unstable-exhaustive-types"), non_exhaustive)]