diff --git a/tower/src/ready_cache/error.rs b/tower/src/ready_cache/error.rs index 0ace900..08115f4 100644 --- a/tower/src/ready_cache/error.rs +++ b/tower/src/ready_cache/error.rs @@ -6,9 +6,12 @@ pub struct Failed(pub K, pub crate::BoxError); // === Failed === -impl std::fmt::Debug for Failed { +impl std::fmt::Debug for Failed { fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - std::fmt::Debug::fmt(&self.1, f) + f.debug_tuple("Failed") + .field(&self.0) + .field(&self.1) + .finish() } } @@ -18,8 +21,8 @@ impl std::fmt::Display for Failed { } } -impl std::error::Error for Failed { +impl std::error::Error for Failed { fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - self.1.source() + Some(&*self.1) } }