Rewrite some Display & Debug implementations

To delete in a more obvious way and to include debug formatting for
Debug impls (i.e. enclose the string in quotes).
This commit is contained in:
Jonas Platte 2021-11-18 19:49:40 +01:00
parent 3959ec4abb
commit 1a87403ba2
No known key found for this signature in database
GPG Key ID: 7D261D771D915378
8 changed files with 9 additions and 9 deletions

View File

@ -140,7 +140,7 @@ where
impl fmt::Display for TagName {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_ref())
self.as_ref().fmt(f)
}
}

View File

@ -13,7 +13,7 @@ pub struct DeviceKeyId {
impl fmt::Debug for DeviceKeyId {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(&self.full_id)
self.full_id.fmt(f)
}
}

View File

@ -45,7 +45,7 @@ pub struct EventId {
impl fmt::Debug for EventId {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(&self.full_id)
self.full_id.fmt(f)
}
}

View File

@ -66,13 +66,13 @@ impl MxcUri {
impl fmt::Debug for MxcUri {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(&self.full_uri)
self.full_uri.fmt(f)
}
}
impl fmt::Display for MxcUri {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(&self.full_uri)
self.full_uri.fmt(f)
}
}

View File

@ -25,7 +25,7 @@ pub struct RoomAliasId {
impl fmt::Debug for RoomAliasId {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(&self.full_id)
self.full_id.fmt(f)
}
}

View File

@ -25,7 +25,7 @@ pub struct RoomId {
impl fmt::Debug for RoomId {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(&self.full_id)
self.full_id.fmt(f)
}
}

View File

@ -36,7 +36,7 @@ pub struct RoomIdOrAliasId {
impl fmt::Debug for RoomIdOrAliasId {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(&self.full_id)
self.full_id.fmt(f)
}
}

View File

@ -32,7 +32,7 @@ pub struct UserId {
impl fmt::Debug for UserId {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(&self.full_id)
self.full_id.fmt(f)
}
}