remove some noise from Error debug format

This commit is contained in:
Sean McArthur
2019-04-25 10:32:53 -07:00
parent e4b91ad201
commit 17850942c8

View File

@@ -233,10 +233,16 @@ impl Error {
impl fmt::Debug for Error {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.debug_struct("Error")
.field("kind", &self.inner.kind)
.field("url", &self.inner.url)
if let Some(ref url) = self.inner.url {
f.debug_tuple("Error")
.field(&self.inner.kind)
.field(url)
.finish()
} else {
f.debug_tuple("Error")
.field(&self.inner.kind)
.finish()
}
}
}