Comments
Patch
@@ -53,12 +53,21 @@
/// the size or return an error at runtime.
///
/// [`nybbles_len`]: #method.nybbles_len
-#[derive(Copy, Clone, Debug, PartialEq, BytesCast, derive_more::From)]
+#[derive(Copy, Clone, PartialEq, BytesCast, derive_more::From)]
#[repr(transparent)]
pub struct Node {
data: NodeData,
}
+impl fmt::Debug for Node {
+ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+ let n = format!("{:x?}", self.data);
+ // We're using debug_tuple because it makes the output a little
+ // more compact without losing data.
+ f.debug_tuple("Node").field(&n).finish()
+ }
+}
+
/// The node value for NULL_REVISION
pub const NULL_NODE: Node = Node {
data: [0; NODE_BYTES_LENGTH],