From 603fd5744f0e88bf41809a41b8a687d37b28be36 Mon Sep 17 00:00:00 2001 From: Pierre Krieger Date: Tue, 4 Jun 2019 13:08:37 +0200 Subject: [PATCH] No longer require fmt::Debug when not necessary (#1158) --- core/src/either.rs | 4 ++-- core/src/protocols_handler/node_handler.rs | 5 ----- core/src/swarm/swarm.rs | 14 +++++++------- 3 files changed, 9 insertions(+), 14 deletions(-) diff --git a/core/src/either.rs b/core/src/either.rs index df992f92..7aae0388 100644 --- a/core/src/either.rs +++ b/core/src/either.rs @@ -44,8 +44,8 @@ where impl std::error::Error for EitherError where - A: fmt::Debug + std::error::Error, - B: fmt::Debug + std::error::Error + A: std::error::Error, + B: std::error::Error { fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { match self { diff --git a/core/src/protocols_handler/node_handler.rs b/core/src/protocols_handler/node_handler.rs index 65427f67..87825d39 100644 --- a/core/src/protocols_handler/node_handler.rs +++ b/core/src/protocols_handler/node_handler.rs @@ -26,7 +26,6 @@ use crate::{ protocols_handler::{KeepAlive, ProtocolsHandler, IntoProtocolsHandler, ProtocolsHandlerEvent, ProtocolsHandlerUpgrErr}, upgrade::{ self, - OutboundUpgrade, InboundUpgradeApply, OutboundUpgradeApply, } @@ -75,8 +74,6 @@ impl IntoNodeHandler<(PeerId, ConnectedPoint)> where TIntoProtoHandler: IntoProtocolsHandler, TProtoHandler: ProtocolsHandler, - // TODO: meh for Debug - ::Substream>>::Error: std::fmt::Debug { type Handler = NodeHandlerWrapper; @@ -179,8 +176,6 @@ where impl NodeHandler for NodeHandlerWrapper where TProtoHandler: ProtocolsHandler, - // TODO: meh for Debug - ::Substream>>::Error: std::fmt::Debug { type InEvent = TProtoHandler::InEvent; type OutEvent = TProtoHandler::OutEvent; diff --git a/core/src/swarm/swarm.rs b/core/src/swarm/swarm.rs index b35eebaf..ed090dce 100644 --- a/core/src/swarm/swarm.rs +++ b/core/src/swarm/swarm.rs @@ -33,7 +33,7 @@ use crate::{ }; use futures::prelude::*; use smallvec::SmallVec; -use std::{error, fmt, io, ops::{Deref, DerefMut}}; +use std::{error, io, ops::{Deref, DerefMut}}; use std::collections::HashSet; /// Contains the state of the network, plus the way it should behave. @@ -123,14 +123,14 @@ where TBehaviour: NetworkBehaviour, <<::Handler as ProtocolsHandler>::InboundProtocol as UpgradeInfo>::Info: Send + 'static, <<::Handler as ProtocolsHandler>::InboundProtocol as UpgradeInfo>::InfoIter: Send + 'static, <<<::Handler as ProtocolsHandler>::InboundProtocol as UpgradeInfo>::InfoIter as IntoIterator>::IntoIter: Send + 'static, - <<::Handler as ProtocolsHandler>::InboundProtocol as InboundUpgrade>>::Error: fmt::Debug + Send + 'static, + <<::Handler as ProtocolsHandler>::InboundProtocol as InboundUpgrade>>::Error: Send + 'static, <<::Handler as ProtocolsHandler>::InboundProtocol as InboundUpgrade>>::Future: Send + 'static, <::Handler as ProtocolsHandler>::OutboundProtocol: OutboundUpgrade> + Send + 'static, <<::Handler as ProtocolsHandler>::OutboundProtocol as UpgradeInfo>::Info: Send + 'static, <<::Handler as ProtocolsHandler>::OutboundProtocol as UpgradeInfo>::InfoIter: Send + 'static, <<<::Handler as ProtocolsHandler>::OutboundProtocol as UpgradeInfo>::InfoIter as IntoIterator>::IntoIter: Send + 'static, <<::Handler as ProtocolsHandler>::OutboundProtocol as OutboundUpgrade>>::Future: Send + 'static, - <<::Handler as ProtocolsHandler>::OutboundProtocol as OutboundUpgrade>>::Error: fmt::Debug + Send + 'static, + <<::Handler as ProtocolsHandler>::OutboundProtocol as OutboundUpgrade>>::Error: Send + 'static, ::Handler> as NodeHandler>::OutboundOpenInfo: Send + 'static, // TODO: shouldn't be necessary { /// Builds a new `Swarm`. @@ -240,13 +240,13 @@ where TBehaviour: NetworkBehaviour, <::Handler as ProtocolsHandler>::OutboundOpenInfo: Send + 'static, // TODO: shouldn't be necessary <::Handler as ProtocolsHandler>::InboundProtocol: InboundUpgrade> + Send + 'static, <<::Handler as ProtocolsHandler>::InboundProtocol as InboundUpgrade>>::Future: Send + 'static, - <<::Handler as ProtocolsHandler>::InboundProtocol as InboundUpgrade>>::Error: fmt::Debug + Send + 'static, + <<::Handler as ProtocolsHandler>::InboundProtocol as InboundUpgrade>>::Error: Send + 'static, <<::Handler as ProtocolsHandler>::InboundProtocol as UpgradeInfo>::Info: Send + 'static, <<::Handler as ProtocolsHandler>::InboundProtocol as UpgradeInfo>::InfoIter: Send + 'static, <<<::Handler as ProtocolsHandler>::InboundProtocol as UpgradeInfo>::InfoIter as IntoIterator>::IntoIter: Send + 'static, <::Handler as ProtocolsHandler>::OutboundProtocol: OutboundUpgrade> + Send + 'static, <<::Handler as ProtocolsHandler>::OutboundProtocol as OutboundUpgrade>>::Future: Send + 'static, - <<::Handler as ProtocolsHandler>::OutboundProtocol as OutboundUpgrade>>::Error: fmt::Debug + Send + 'static, + <<::Handler as ProtocolsHandler>::OutboundProtocol as OutboundUpgrade>>::Error: Send + 'static, <<::Handler as ProtocolsHandler>::OutboundProtocol as UpgradeInfo>::Info: Send + 'static, <<::Handler as ProtocolsHandler>::OutboundProtocol as UpgradeInfo>::InfoIter: Send + 'static, <<<::Handler as ProtocolsHandler>::OutboundProtocol as UpgradeInfo>::InfoIter as IntoIterator>::IntoIter: Send + 'static, @@ -414,14 +414,14 @@ where TBehaviour: NetworkBehaviour, <<<::ProtocolsHandler as IntoProtocolsHandler>::Handler as ProtocolsHandler>::InboundProtocol as UpgradeInfo>::Info: Send + 'static, <<<::ProtocolsHandler as IntoProtocolsHandler>::Handler as ProtocolsHandler>::InboundProtocol as UpgradeInfo>::InfoIter: Send + 'static, <<<<::ProtocolsHandler as IntoProtocolsHandler>::Handler as ProtocolsHandler>::InboundProtocol as UpgradeInfo>::InfoIter as IntoIterator>::IntoIter: Send + 'static, - <<<::ProtocolsHandler as IntoProtocolsHandler>::Handler as ProtocolsHandler>::InboundProtocol as InboundUpgrade>>::Error: fmt::Debug + Send + 'static, + <<<::ProtocolsHandler as IntoProtocolsHandler>::Handler as ProtocolsHandler>::InboundProtocol as InboundUpgrade>>::Error: Send + 'static, <<<::ProtocolsHandler as IntoProtocolsHandler>::Handler as ProtocolsHandler>::InboundProtocol as InboundUpgrade>>::Future: Send + 'static, <<::ProtocolsHandler as IntoProtocolsHandler>::Handler as ProtocolsHandler>::OutboundProtocol: OutboundUpgrade> + Send + 'static, <<<::ProtocolsHandler as IntoProtocolsHandler>::Handler as ProtocolsHandler>::OutboundProtocol as UpgradeInfo>::Info: Send + 'static, <<<::ProtocolsHandler as IntoProtocolsHandler>::Handler as ProtocolsHandler>::OutboundProtocol as UpgradeInfo>::InfoIter: Send + 'static, <<<<::ProtocolsHandler as IntoProtocolsHandler>::Handler as ProtocolsHandler>::OutboundProtocol as UpgradeInfo>::InfoIter as IntoIterator>::IntoIter: Send + 'static, <<<::ProtocolsHandler as IntoProtocolsHandler>::Handler as ProtocolsHandler>::OutboundProtocol as OutboundUpgrade>>::Future: Send + 'static, - <<<::ProtocolsHandler as IntoProtocolsHandler>::Handler as ProtocolsHandler>::OutboundProtocol as OutboundUpgrade>>::Error: fmt::Debug + Send + 'static, + <<<::ProtocolsHandler as IntoProtocolsHandler>::Handler as ProtocolsHandler>::OutboundProtocol as OutboundUpgrade>>::Error: Send + 'static, ::ProtocolsHandler as IntoProtocolsHandler>::Handler> as NodeHandler>::OutboundOpenInfo: Send + 'static, // TODO: shouldn't be necessary {