feat(swarm)!: remove unused PendingConnectionError::Io variant (#3373)

This variant is never constructed.
This commit is contained in:
Thomas Eizinger
2023-01-26 16:26:54 +11:00
committed by GitHub
parent c94aabf8f6
commit 90af08cb59
4 changed files with 5 additions and 10 deletions

View File

@ -101,10 +101,6 @@ pub enum PendingConnectionError<TTransErr> {
obtained: PeerId,
endpoint: ConnectedPoint,
},
/// An I/O error occurred on the connection.
// TODO: Eventually this should also be a custom error?
IO(io::Error),
}
impl<T> PendingConnectionError<T> {
@ -118,7 +114,6 @@ impl<T> PendingConnectionError<T> {
PendingConnectionError::WrongPeerId { obtained, endpoint } => {
PendingConnectionError::WrongPeerId { obtained, endpoint }
}
PendingConnectionError::IO(e) => PendingConnectionError::IO(e),
}
}
}
@ -129,7 +124,6 @@ where
{
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
PendingConnectionError::IO(err) => write!(f, "Pending connection: I/O error: {err}"),
PendingConnectionError::Aborted => write!(f, "Pending connection: Aborted."),
PendingConnectionError::Transport(err) => {
write!(
@ -156,7 +150,6 @@ where
{
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match self {
PendingConnectionError::IO(err) => Some(err),
PendingConnectionError::Transport(_) => None,
PendingConnectionError::WrongPeerId { .. } => None,
PendingConnectionError::Aborted => None,

View File

@ -1611,7 +1611,6 @@ impl From<PendingOutboundConnectionError> for DialError {
PendingConnectionError::WrongPeerId { obtained, endpoint } => {
DialError::WrongPeerId { obtained, endpoint }
}
PendingConnectionError::IO(e) => DialError::ConnectionIo(e),
PendingConnectionError::Transport(e) => DialError::Transport(e),
}
}