Skip to content

Commit cc62a8f

Browse files
committed
Improve debug print for Handle.
It's obvious it's a handle from context, so just print the inner value. And print it as hex because it might be large.
1 parent fe05b9f commit cc62a8f

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/filesystem/handles.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,17 @@
22
33
use core::num::Wrapping;
44

5-
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
5+
#[derive(Clone, Copy, PartialEq, Eq)]
66
#[cfg_attr(feature = "defmt-log", derive(defmt::Format))]
77
/// Unique ID used to identify things in the open Volume/File/Directory lists
88
pub struct Handle(pub(crate) u32);
99

10+
impl core::fmt::Debug for Handle {
11+
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
12+
write!(f, "{:#08x}", self.0)
13+
}
14+
}
15+
1016
/// A Handle Generator.
1117
///
1218
/// This object will always return a different ID.

0 commit comments

Comments
 (0)