Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(swarm): remove unused DialError::ConnectionIo variant #3374

Merged
merged 8 commits into from
Jan 26, 2023
4 changes: 0 additions & 4 deletions misc/metrics/src/swarm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -246,9 +246,6 @@ impl<TBvEv, THandleErr> super::Recorder<libp2p_swarm::SwarmEvent<TBvEv, THandleE
libp2p_swarm::DialError::WrongPeerId { .. } => {
record(OutgoingConnectionErrorError::WrongPeerId)
}
libp2p_swarm::DialError::ConnectionIo(_) => {
record(OutgoingConnectionErrorError::ConnectionIo)
}
};
}
libp2p_swarm::SwarmEvent::BannedPeer { endpoint, .. } => {
Expand Down Expand Up @@ -347,7 +344,6 @@ enum OutgoingConnectionErrorError {
Aborted,
InvalidPeerId,
WrongPeerId,
ConnectionIo,
TransportMultiaddrNotSupported,
TransportOther,
}
Expand Down
1 change: 0 additions & 1 deletion protocols/kad/src/behaviour.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1936,7 +1936,6 @@ where
| DialError::InvalidPeerId { .. }
| DialError::WrongPeerId { .. }
| DialError::Aborted
| DialError::ConnectionIo(_)
| DialError::Transport(_)
| DialError::NoAddresses => {
if let DialError::Transport(addresses) = error {
Expand Down
5 changes: 5 additions & 0 deletions swarm/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@
This was never constructed.
See [PR 3373].

- Remove `DialError::ConnectionIo` variant.
This was never constructed.
See [PR 3374].

[PR 3364]: https://github.com/libp2p/rust-libp2p/pull/3364
[PR 3170]: https://github.com/libp2p/rust-libp2p/pull/3170
[PR 3134]: https://github.com/libp2p/rust-libp2p/pull/3134
Expand All @@ -39,6 +43,7 @@
[PR 3188]: https://github.com/libp2p/rust-libp2p/pull/3188
[PR 3377]: https://github.com/libp2p/rust-libp2p/pull/3377
[PR 3373]: https://github.com/libp2p/rust-libp2p/pull/3373
[PR 3374]: https://github.com/libp2p/rust-libp2p/pull/3374

# 0.41.1

Expand Down
7 changes: 0 additions & 7 deletions swarm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1597,8 +1597,6 @@ pub enum DialError {
obtained: PeerId,
endpoint: ConnectedPoint,
},
/// An I/O error occurred on the connection.
ConnectionIo(io::Error),
/// An error occurred while negotiating the transport protocol(s) on a connection.
Transport(Vec<(Multiaddr, TransportError<io::Error>)>),
}
Expand Down Expand Up @@ -1641,10 +1639,6 @@ impl fmt::Display for DialError {
f,
"Dial error: Unexpected peer ID {obtained} at {endpoint:?}."
),
DialError::ConnectionIo(e) => write!(
f,
"Dial error: An I/O error occurred on the connection: {e:?}."
),
DialError::Transport(errors) => {
write!(f, "Failed to negotiate transport protocol(s): [")?;

Expand Down Expand Up @@ -1682,7 +1676,6 @@ impl error::Error for DialError {
DialError::Aborted => None,
DialError::InvalidPeerId { .. } => None,
DialError::WrongPeerId { .. } => None,
DialError::ConnectionIo(_) => None,
DialError::Transport(_) => None,
}
}
Expand Down