From 3593b8ebf7ae032481c59007891bebe2be2ac1ca Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Wed, 30 Jul 2025 01:17:28 +0000 Subject: [PATCH] Implement Debug for RawPduId. Signed-off-by: Jason Volk --- src/core/matrix/pdu/raw_id.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/core/matrix/pdu/raw_id.rs b/src/core/matrix/pdu/raw_id.rs index effb72e4..0fe3d9c7 100644 --- a/src/core/matrix/pdu/raw_id.rs +++ b/src/core/matrix/pdu/raw_id.rs @@ -1,8 +1,10 @@ +use std::fmt; + use arrayvec::ArrayVec; use super::{Count, Id, ShortEventId, ShortId, ShortRoomId}; -#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] +#[derive(Clone, Copy, Eq, Hash, PartialEq)] pub enum RawId { Normal(RawIdNormal), Backfilled(RawIdBackfilled), @@ -61,6 +63,13 @@ impl RawId { } } +impl fmt::Debug for RawId { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + let id: Id = (*self).into(); + write!(f, "{id:?}") + } +} + impl AsRef<[u8]> for RawId { #[inline] fn as_ref(&self) -> &[u8] { self.as_bytes() }