Abide by formatting in 'Debug' implementations.

This commit is contained in:
Jacob Pratt 2019-09-14 00:07:19 -04:00 committed by Sergio Benitez
parent b29b2db35e
commit a1cca97587
4 changed files with 5 additions and 5 deletions

View File

@ -414,8 +414,8 @@ impl<'a> Cookies<'a> {
impl<'a> fmt::Debug for Cookies<'a> {
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)
}
}
}

View File

@ -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)
}
}

View File

@ -1185,7 +1185,7 @@ impl<'r> fmt::Debug for Response<'r> {
}
match self.body {
Some(ref body) => writeln!(f, "{:?}", body),
Some(ref body) => body.fmt(f),
None => writeln!(f, "Empty Body")
}
}

View File

@ -36,7 +36,7 @@ impl<T: Read> Stream<T> {
impl<T: Read + Debug> Debug for Stream<T> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "Stream({:?})", self.0)
f.debug_tuple("Stream").field(&self.0).finish()
}
}