From: Ian Jackson Date: Sun, 1 Aug 2021 19:04:44 +0000 (+0100) Subject: wip debug, make it a Debug X-Git-Tag: hippotat/1.0.0~392 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ian/git?a=commitdiff_plain;h=7ca340afd021c4286c74eac9cf65ff3ebc79ded6;p=hippotat.git wip debug, make it a Debug Signed-off-by: Ian Jackson --- diff --git a/src/slip.rs b/src/slip.rs index f33bfc1..acd863d 100644 --- a/src/slip.rs +++ b/src/slip.rs @@ -10,7 +10,7 @@ pub static SLIP_END_SLICE: &[u8] = &[SLIP_END]; pub fn check_checkmtu_mimeswap (mtu: u32, data: &mut [u8]) { -// eprintln!("before: {}", DumpHex(data)); +// eprintln!("before: {:?}", DumpHex(data)); for mut packet in data.split_mut(|&c| c == SLIP_END) { if packet.len() > mtu.sat() { @@ -30,7 +30,7 @@ pub fn check_checkmtu_mimeswap } } -// eprintln!(" after: {}", DumpHex(data)); +// eprintln!(" after: {:?}", DumpHex(data)); } pub type Frame = Vec; @@ -65,7 +65,7 @@ impl From for FramesData { } pub struct DumpHex<'b>(pub &'b [u8]); -impl Display for DumpHex<'_> { +impl Debug for DumpHex<'_> { #[throws(fmt::Error)] fn fmt(&self, f: &mut fmt::Formatter) { for v in self.0 { write!(f, "{:02x}", v)?; }