mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-07-30 16:31:57 +00:00
Fix Display impl for NegotiationError. (#1243)
This commit is contained in:
@@ -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.")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user