From bed93133b8bc7d206893bbf823f7fdfeb6222325 Mon Sep 17 00:00:00 2001 From: Jacob Pratt Date: Sat, 14 Sep 2019 00:07:19 -0400 Subject: [PATCH] Abide by formatting in 'Debug' implementations. --- core/http/src/cookies.rs | 4 ++-- core/lib/src/error.rs | 2 +- core/lib/src/response/response.rs | 2 +- core/lib/src/response/stream.rs | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/core/http/src/cookies.rs b/core/http/src/cookies.rs index c9e82b5d..13059c55 100644 --- a/core/http/src/cookies.rs +++ b/core/http/src/cookies.rs @@ -403,8 +403,8 @@ impl Cookies<'_> { impl fmt::Debug for Cookies<'_> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match *self { - Cookies::Jarred(ref jar, _) => write!(f, "{:?}", jar), - Cookies::Empty(ref jar) => write!(f, "{:?}", jar) + Cookies::Jarred(ref jar, _) => jar.fmt(f), + Cookies::Empty(ref jar) => jar.fmt(f) } } } diff --git a/core/lib/src/error.rs b/core/lib/src/error.rs index 1993794e..5abc7af9 100644 --- a/core/lib/src/error.rs +++ b/core/lib/src/error.rs @@ -154,7 +154,7 @@ impl fmt::Debug for LaunchError { #[inline] fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { self.mark_handled(); - write!(f, "{:?}", self.kind()) + self.kind().fmt(f) } } diff --git a/core/lib/src/response/response.rs b/core/lib/src/response/response.rs index 64a2afaa..b6de416c 100644 --- a/core/lib/src/response/response.rs +++ b/core/lib/src/response/response.rs @@ -1185,7 +1185,7 @@ impl fmt::Debug for Response<'_> { } match self.body { - Some(ref body) => writeln!(f, "{:?}", body), + Some(ref body) => body.fmt(f), None => writeln!(f, "Empty Body") } } diff --git a/core/lib/src/response/stream.rs b/core/lib/src/response/stream.rs index 84e106cc..d0cec5f5 100644 --- a/core/lib/src/response/stream.rs +++ b/core/lib/src/response/stream.rs @@ -36,7 +36,7 @@ impl Stream { impl Debug for Stream { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - write!(f, "Stream({:?})", self.0) + f.debug_tuple("Stream").field(&self.0).finish() } }