mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-06-22 14:21:33 +00:00
Cleanup. (#803)
- Use `Error::source` instead of `Error::cause`. - Remove unused import.
This commit is contained in:
@ -47,10 +47,10 @@ where
|
|||||||
A: fmt::Debug + std::error::Error,
|
A: fmt::Debug + std::error::Error,
|
||||||
B: fmt::Debug + std::error::Error
|
B: fmt::Debug + std::error::Error
|
||||||
{
|
{
|
||||||
fn cause(&self) -> Option<&dyn std::error::Error> {
|
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
|
||||||
match self {
|
match self {
|
||||||
EitherError::A(a) => a.cause(),
|
EitherError::A(a) => a.source(),
|
||||||
EitherError::B(b) => b.cause()
|
EitherError::B(b) => b.source()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -25,7 +25,7 @@ use crate::topology::IdentifyTopology;
|
|||||||
use futures::prelude::*;
|
use futures::prelude::*;
|
||||||
use libp2p_core::protocols_handler::{ProtocolsHandler, ProtocolsHandlerSelect, ProtocolsHandlerUpgrErr};
|
use libp2p_core::protocols_handler::{ProtocolsHandler, ProtocolsHandlerSelect, ProtocolsHandlerUpgrErr};
|
||||||
use libp2p_core::swarm::{ConnectedPoint, NetworkBehaviour, NetworkBehaviourAction, PollParameters};
|
use libp2p_core::swarm::{ConnectedPoint, NetworkBehaviour, NetworkBehaviourAction, PollParameters};
|
||||||
use libp2p_core::{Multiaddr, PeerId, either::EitherOutput, topology::Topology};
|
use libp2p_core::{Multiaddr, PeerId, either::EitherOutput};
|
||||||
use smallvec::SmallVec;
|
use smallvec::SmallVec;
|
||||||
use std::{collections::HashMap, collections::VecDeque, io};
|
use std::{collections::HashMap, collections::VecDeque, io};
|
||||||
use tokio_io::{AsyncRead, AsyncWrite};
|
use tokio_io::{AsyncRead, AsyncWrite};
|
||||||
|
Reference in New Issue
Block a user