Skip to content

Commit e70922e

Browse files
committed
feat: octal Debug representation of tree::EntryMode.
This makes it easier to reason about.
1 parent d776656 commit e70922e

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

gix-object/src/tree/mod.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,16 @@ pub struct Editor<'a> {
4242
///
4343
/// Note that even though it can be created from any `u16`, it should be preferable to
4444
/// create it by converting [`EntryKind`] into `EntryMode`.
45-
#[derive(Clone, Copy, PartialEq, Eq, Debug, Ord, PartialOrd, Hash)]
45+
#[derive(Clone, Copy, PartialEq, Eq, Ord, PartialOrd, Hash)]
4646
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4747
pub struct EntryMode(pub u16);
4848

49+
impl std::fmt::Debug for EntryMode {
50+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
51+
write!(f, "EntryMode({:#o})", self.0)
52+
}
53+
}
54+
4955
/// A discretized version of ideal and valid values for entry modes.
5056
///
5157
/// Note that even though it can represent every valid [mode](EntryMode), it might

0 commit comments

Comments
 (0)