mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-06-21 22:01:34 +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,
|
||||
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 {
|
||||
EitherError::A(a) => a.cause(),
|
||||
EitherError::B(b) => b.cause()
|
||||
EitherError::A(a) => a.source(),
|
||||
EitherError::B(b) => b.source()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -25,7 +25,7 @@ use crate::topology::IdentifyTopology;
|
||||
use futures::prelude::*;
|
||||
use libp2p_core::protocols_handler::{ProtocolsHandler, ProtocolsHandlerSelect, ProtocolsHandlerUpgrErr};
|
||||
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 std::{collections::HashMap, collections::VecDeque, io};
|
||||
use tokio_io::{AsyncRead, AsyncWrite};
|
||||
|
Reference in New Issue
Block a user