mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2024-10-01 01:45:40 -04:00
Use BoxFuture
type alias to avoid clippy's complexity nag
This commit is contained in:
parent
d01e444c90
commit
97a09807dd
@ -1,7 +1,6 @@
|
|||||||
use anyhow::{anyhow, Result};
|
use anyhow::{anyhow, Result};
|
||||||
use data_encoding::BASE32;
|
use data_encoding::BASE32;
|
||||||
use futures::future::Ready;
|
use futures::future::{BoxFuture, Ready};
|
||||||
use futures::prelude::*;
|
|
||||||
use libp2p::core::multiaddr::{Multiaddr, Protocol};
|
use libp2p::core::multiaddr::{Multiaddr, Protocol};
|
||||||
use libp2p::core::transport::TransportError;
|
use libp2p::core::transport::TransportError;
|
||||||
use libp2p::core::Transport;
|
use libp2p::core::Transport;
|
||||||
@ -9,7 +8,6 @@ use libp2p::tcp::tokio::{Tcp, TcpStream};
|
|||||||
use libp2p::tcp::{GenTcpConfig, TcpListenStream, TokioTcpConfig};
|
use libp2p::tcp::{GenTcpConfig, TcpListenStream, TokioTcpConfig};
|
||||||
use std::io;
|
use std::io;
|
||||||
use std::net::{Ipv4Addr, SocketAddr, SocketAddrV4};
|
use std::net::{Ipv4Addr, SocketAddr, SocketAddrV4};
|
||||||
use std::pin::Pin;
|
|
||||||
use tokio_socks::tcp::Socks5Stream;
|
use tokio_socks::tcp::Socks5Stream;
|
||||||
use tokio_socks::IntoTargetAddr;
|
use tokio_socks::IntoTargetAddr;
|
||||||
|
|
||||||
@ -35,8 +33,7 @@ impl Transport for TorTcpConfig {
|
|||||||
type Error = io::Error;
|
type Error = io::Error;
|
||||||
type Listener = TcpListenStream<Tcp>;
|
type Listener = TcpListenStream<Tcp>;
|
||||||
type ListenerUpgrade = Ready<Result<Self::Output, Self::Error>>;
|
type ListenerUpgrade = Ready<Result<Self::Output, Self::Error>>;
|
||||||
#[allow(clippy::type_complexity)]
|
type Dial = BoxFuture<'static, Result<Self::Output, Self::Error>>;
|
||||||
type Dial = Pin<Box<dyn Future<Output = Result<Self::Output, Self::Error>> + Send>>;
|
|
||||||
|
|
||||||
fn listen_on(self, addr: Multiaddr) -> Result<Self::Listener, TransportError<Self::Error>> {
|
fn listen_on(self, addr: Multiaddr) -> Result<Self::Listener, TransportError<Self::Error>> {
|
||||||
self.inner.listen_on(addr)
|
self.inner.listen_on(addr)
|
||||||
|
Loading…
Reference in New Issue
Block a user