Implement Debug for RawPduId.

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk
2025-07-30 01:17:28 +00:00
parent 80015a6a30
commit 3593b8ebf7

View File

@@ -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() }