Show 0x00-bytes as '⋄' instead of '0', closes #166

This commit is contained in:
David Peter committed 2022-12-05 09:45:38 +01:00
1 parent c6af2edda8
commit 7d38f70918
3 files changed
+26 -29

No files matched your search

+3 -3
View File
@@ -82,7 +82,7 @@ impl Byte {
use crate::ByteCategory::*;
match self.category() {
Null => '0',
Null => '⋄',
AsciiPrintable => self.0 as char,
AsciiWhitespace if self.0 == 0x20 => ' ',
AsciiWhitespace => '_',
@@ -819,9 +819,9 @@ mod tests {
let input = io::Cursor::new(b"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00");
let expected_string = "\
┌────────┬─────────────────────────┬─────────────────────────┬────────┬────────┐
│00000000│ 00 00 00 00 00 00 00 00 ┊ 00 00 00 00 00 00 00 00 │00000000┊00000000│
│00000000│ 00 00 00 00 00 00 00 00 ┊ 00 00 00 00 00 00 00 00 │⋄⋄⋄⋄⋄⋄⋄⋄┊⋄⋄⋄⋄⋄⋄⋄⋄│
│* │ ┊ │ ┊ │
│00000020│ 00 ┊ │0 ┊ │
│00000020│ 00 ┊ │⋄ ┊ │
└────────┴─────────────────────────┴─────────────────────────┴────────┴────────┘
"
.to_owned();