diff --git a/swarm/src/handler.rs b/swarm/src/handler.rs index cf8b9c1f2cb9..f48021a57979 100644 --- a/swarm/src/handler.rs +++ b/swarm/src/handler.rs @@ -457,7 +457,7 @@ impl ConnectionHandlerUpgrErr { impl fmt::Display for ConnectionHandlerUpgrErr where - TUpgrErr: fmt::Display, + TUpgrErr: error::Error + 'static, { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match self { @@ -467,7 +467,7 @@ where ConnectionHandlerUpgrErr::Timer => { write!(f, "Timer error while opening a substream") } - ConnectionHandlerUpgrErr::Upgrade(err) => write!(f, "{err}"), + err @ ConnectionHandlerUpgrErr::Upgrade(_) => crate::print_error_chain(f, err), } } }