Skip to content

Commit 70ac4a6

Browse files
committed
multiboot2: TagTypeId: better debug impl
1 parent 201ea4b commit 70ac4a6

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

multiboot2/src/tag_type.rs

+8-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ use core::str::Utf8Error;
1919
/// Multiboot2 [`Tag`]. This type can easily be created from or converted to
2020
/// [`TagType`].
2121
#[repr(transparent)]
22-
#[derive(Copy, Clone, Debug, PartialOrd, PartialEq, Eq, Ord, Hash)]
22+
#[derive(Copy, Clone, PartialOrd, PartialEq, Eq, Ord, Hash)]
2323
pub struct TagTypeId(u32);
2424

2525
impl TagTypeId {
@@ -29,6 +29,13 @@ impl TagTypeId {
2929
}
3030
}
3131

32+
impl Debug for TagTypeId {
33+
fn fmt(&self, f: &mut Formatter<'_>) -> core::fmt::Result {
34+
let tag_type = TagType::from(*self);
35+
Debug::fmt(&tag_type, f)
36+
}
37+
}
38+
3239
/// Higher level abstraction for [`TagTypeId`] that assigns each possible value
3340
/// to a specific semantic according to the specification. Additionally, it
3441
/// allows to use the [`TagType::Custom`] variant. It is **not binary compatible**

0 commit comments

Comments
 (0)