Fix Display impl for NegotiationError.
@@ -334,7 +334,12 @@ impl Error for NegotiationError {
impl fmt::Display for NegotiationError {
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> Result<(), fmt::Error> {
- write!(fmt, "{}", Error::description(self))
+ match self {
+ NegotiationError::ProtocolError(p) =>
+ fmt.write_fmt(format_args!("Protocol error: {}", p)),
+ NegotiationError::Failed =>
+ fmt.write_str("Protocol negotiation failed.")
+ }
}
}
