Skip to content

Commit 29451cd

Browse files
authored
Omit InnerId from Debug representation of *Id (#3318)
They're mostly just noise, the library user doesn't care about the inner representation. The debug representation goes from `GuildId(InnerId(1))` to `GuildId(1)`.
1 parent dc6b554 commit 29451cd

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/model/id.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,10 +137,17 @@ macro_rules! id_u64 {
137137
}
138138

139139
/// The inner storage of an ID.
140-
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
140+
#[derive(Clone, Copy, Eq, Hash, Ord, PartialEq, PartialOrd)]
141141
#[repr(Rust, packed)]
142142
pub(crate) struct InnerId(NonZeroU64);
143143

144+
impl fmt::Debug for InnerId {
145+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
146+
let inner = self.0;
147+
inner.fmt(f)
148+
}
149+
}
150+
144151
struct SnowflakeVisitor;
145152

146153
impl serde::de::Visitor<'_> for SnowflakeVisitor {

0 commit comments

Comments
 (0)