refactor(swarm)!: don't be generic over Transport (#3272)

Ever since we moved `Pool` into `libp2p-swarm`, we always use it with the same `Transport`: `Boxed`. It is thus unnecessary for us to be overly generic over what kind of `Transport` we are using. This allows us to remove a few type parameters from the implementation which overall simplifies things.

This is technically a breaking change because I am removing a type parameter from two exported type aliases:

- `PendingInboundConnectionError`
- `PendingOutboundConnectionError`

Those have always only be used with `std::io::Error` in our API but it is still a breaking change.
This commit is contained in:
Thomas Eizinger
2022-12-23 11:13:34 +11:00
committed by GitHub
parent aca3454c91
commit 5782a96af2
7 changed files with 62 additions and 98 deletions

View File

@ -370,10 +370,8 @@ enum PendingInboundConnectionError {
ConnectionLimit,
}
impl<TTransErr> From<&libp2p_swarm::PendingInboundConnectionError<TTransErr>>
for PendingInboundConnectionError
{
fn from(error: &libp2p_swarm::PendingInboundConnectionError<TTransErr>) -> Self {
impl From<&libp2p_swarm::PendingInboundConnectionError> for PendingInboundConnectionError {
fn from(error: &libp2p_swarm::PendingInboundConnectionError) -> Self {
match error {
libp2p_swarm::PendingInboundConnectionError::WrongPeerId { .. } => {
PendingInboundConnectionError::WrongPeerId