chiark / gitweb /
wip debug, make it a Debug
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 1 Aug 2021 19:04:44 +0000 (20:04 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 1 Aug 2021 19:04:44 +0000 (20:04 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
src/slip.rs

index f33bfc13a599a5964bfff8268cb21d0562e6a1b6..acd863d8d599a8eec7edc23cb05171fdd5185b1f 100644 (file)
@@ -10,7 +10,7 @@ pub static SLIP_END_SLICE: &[u8] = &[SLIP_END];
 pub fn check_checkmtu_mimeswap<const TO_MIME: bool>
   (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<const TO_MIME: bool>
     }
   }
 
-//  eprintln!(" after: {}", DumpHex(data));
+//  eprintln!(" after: {:?}", DumpHex(data));
 }
 
 pub type Frame = Vec<u8>;
@@ -65,7 +65,7 @@ impl From<Frames> 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)?; }