Skip to content

Commit 1fe8af4

Browse files
committed
debug as string
1 parent b861297 commit 1fe8af4

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/id.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const ENC: &[u8] = "0123456789abcdefghijklmnopqrstuv".as_bytes();
1212
const DEC: [u8; 256] = gen_dec();
1313

1414
/// An ID.
15-
#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Clone, Copy, Hash)]
15+
#[derive(PartialEq, Eq, PartialOrd, Ord, Clone, Copy, Hash)]
1616
pub struct Id(pub [u8; RAW_LEN]);
1717

1818
impl Id {
@@ -84,6 +84,12 @@ impl ToString for Id {
8484
}
8585
}
8686

87+
impl std::fmt::Debug for Id {
88+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
89+
f.debug_tuple("Id").field(&self.to_string()).finish()
90+
}
91+
}
92+
8793
/// An error which can be returned when parsing an id.
8894
#[derive(Error, Debug, PartialEq)]
8995
pub enum ParseIdError {

0 commit comments

Comments
 (0)