From 613d4bd5d56d086ae0fc80746aa111c1ae6b7d2c Mon Sep 17 00:00:00 2001 From: Stepan Koltsov Date: Tue, 21 Mar 2017 07:09:44 +0300 Subject: 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. --- tests/test_bytes.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/test_bytes.rs') 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); -- cgit v1.2.3