Use `BoxFuture` type alias to avoid clippy's complexity nag

pull/558/head
Thomas Eizinger 3 years ago
parent d01e444c90
commit 97a09807dd
No known key found for this signature in database
GPG Key ID: 651AC83A6C6C8B96

@ -1,7 +1,6 @@
use anyhow::{anyhow, Result};
use data_encoding::BASE32;
use futures::future::Ready;
use futures::prelude::*;
use futures::future::{BoxFuture, Ready};
use libp2p::core::multiaddr::{Multiaddr, Protocol};
use libp2p::core::transport::TransportError;
use libp2p::core::Transport;
@ -9,7 +8,6 @@ use libp2p::tcp::tokio::{Tcp, TcpStream};
use libp2p::tcp::{GenTcpConfig, TcpListenStream, TokioTcpConfig};
use std::io;
use std::net::{Ipv4Addr, SocketAddr, SocketAddrV4};
use std::pin::Pin;
use tokio_socks::tcp::Socks5Stream;
use tokio_socks::IntoTargetAddr;
@ -35,8 +33,7 @@ impl Transport for TorTcpConfig {
type Error = io::Error;
type Listener = TcpListenStream<Tcp>;
type ListenerUpgrade = Ready<Result<Self::Output, Self::Error>>;
#[allow(clippy::type_complexity)]
type Dial = Pin<Box<dyn Future<Output = Result<Self::Output, Self::Error>> + Send>>;
type Dial = BoxFuture<'static, Result<Self::Output, Self::Error>>;
fn listen_on(self, addr: Multiaddr) -> Result<Self::Listener, TransportError<Self::Error>> {
self.inner.listen_on(addr)

Loading…
Cancel
Save