aboutsummaryrefslogtreecommitdiff
path: root/tests/test_bytes.rs
diff options
context:
space:
mode:
authorGravatar Stepan Koltsov <stepan.koltsov@gmail.com> 2017-03-21 07:09:44 +0300
committerGravatar Carl Lerche <me@carllerche.com> 2017-03-20 21:09:44 -0700
commit613d4bd5d56d086ae0fc80746aa111c1ae6b7d2c (patch)
tree9fb246dccb008b3411c272d6b33677cc4c22a52e /tests/test_bytes.rs
parentdc9c8e304e60b6038e0df4bfd7abfdc145251310 (diff)
downloadbytes-613d4bd5d56d086ae0fc80746aa111c1ae6b7d2c.tar.gz
bytes-613d4bd5d56d086ae0fc80746aa111c1ae6b7d2c.tar.zst
bytes-613d4bd5d56d086ae0fc80746aa111c1ae6b7d2c.zip
Reimplement fmt::Debug for Bytes and BytesMut (#84)
Standard `Debug` implementation for `[u8]` is comma separated list of numbers. Since large amount of byte strings are in fact ASCII strings or contain a lot of ASCII strings (e. g. HTTP), it is convenient to print strings as ASCII when possible.
Diffstat (limited to 'tests/test_bytes.rs')
-rw-r--r--tests/test_bytes.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/test_bytes.rs b/tests/test_bytes.rs
index 2e163df..5c2c91d 100644
--- a/tests/test_bytes.rs
+++ b/tests/test_bytes.rs
@@ -43,7 +43,7 @@ fn from_slice() {
#[test]
fn fmt() {
let a = format!("{:?}", Bytes::from(&b"abcdefg"[..]));
- let b = format!("{:?}", b"abcdefg");
+ let b = "b\"abcdefg\"";
assert_eq!(a, b);