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 { impl fmt::Debug for Error {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.debug_struct("Error") if let Some(ref url) = self.inner.url {
.field("kind", &self.inner.kind) f.debug_tuple("Error")
.field("url", &self.inner.url) .field(&self.inner.kind)
.finish() .field(url)
.finish()
} else {
f.debug_tuple("Error")
.field(&self.inner.kind)
.finish()
}
} }
} }