Skip to content
Snippets Groups Projects
Commit cfca1c04 authored by Sean McArthur's avatar Sean McArthur Committed by Carl Lerche
Browse files

print space normally in Debug for Bytes (#155)

parent c8c46d85
No related branches found
No related tags found
No related merge requests found
...@@ -27,8 +27,8 @@ impl<'a> fmt::Debug for BsDebug<'a> { ...@@ -27,8 +27,8 @@ impl<'a> fmt::Debug for BsDebug<'a> {
try!(write!(fmt, "\\{}", c as char)); try!(write!(fmt, "\\{}", c as char));
} else if c == b'\0' { } else if c == b'\0' {
try!(write!(fmt, "\\0")); try!(write!(fmt, "\\0"));
// ASCII printable except space // ASCII printable
} else if c > 0x20 && c < 0x7f { } else if c >= 0x20 && c < 0x7f {
try!(write!(fmt, "{}", c as char)); try!(write!(fmt, "{}", c as char));
} else { } else {
try!(write!(fmt, "\\x{:02x}", c)); try!(write!(fmt, "\\x{:02x}", c));
......
...@@ -11,7 +11,7 @@ fn fmt() { ...@@ -11,7 +11,7 @@ fn fmt() {
\\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\ \\x08\\t\\n\\x0b\\x0c\\r\\x0e\\x0f\
\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\ \\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\
\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f\ \\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f\
\\x20!\\\"#$%&'()*+,-./0123456789:;<=>?\ \x20!\\\"#$%&'()*+,-./0123456789:;<=>?\
@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\\\]^_\ @ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\\\]^_\
`abcdefghijklmnopqrstuvwxyz{|}~\\x7f\ `abcdefghijklmnopqrstuvwxyz{|}~\\x7f\
\\x80\\x81\\x82\\x83\\x84\\x85\\x86\\x87\ \\x80\\x81\\x82\\x83\\x84\\x85\\x86\\x87\
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment