print space normally in Debug for Bytes (#155)

This commit is contained in:
Sean McArthur
2017-08-17 10:28:06 -07:00
committed by Carl Lerche
parent c8c46d8513
commit cfca1c04fa
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -27,8 +27,8 @@ impl<'a> fmt::Debug for BsDebug<'a> {
try!(write!(fmt, "\\{}", c as char));
} else if c == b'\0' {
try!(write!(fmt, "\\0"));
// ASCII printable except space
} else if c > 0x20 && c < 0x7f {
// ASCII printable
} else if c >= 0x20 && c < 0x7f {
try!(write!(fmt, "{}", c as char));
} else {
try!(write!(fmt, "\\x{:02x}", c));