- Use `Error::source` instead of `Error::cause`.
- Remove unused import.
This commit is contained in:
Toralf Wittner
2018-12-20 13:41:11 +01:00
committed by GitHub
parent f541df391a
commit 6be3aca768
2 changed files with 4 additions and 4 deletions

View File

@ -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()
} }
} }
} }

View File

@ -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};