diff --git a/swap/src/network/tor_transport.rs b/swap/src/network/tor_transport.rs index a2fc0b56..ee4eb3d2 100644 --- a/swap/src/network/tor_transport.rs +++ b/swap/src/network/tor_transport.rs @@ -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; type ListenerUpgrade = Ready>; - #[allow(clippy::type_complexity)] - type Dial = Pin> + Send>>; + type Dial = BoxFuture<'static, Result>; fn listen_on(self, addr: Multiaddr) -> Result> { self.inner.listen_on(addr)