From bea987b90e513c639b17ce5daaba39a14236b7ff Mon Sep 17 00:00:00 2001 From: Mikhail Zabaluev Date: Tue, 4 Jun 2019 09:38:36 +0300 Subject: [PATCH] Addressed minor review comments As per discussion in tower-rs/tower-hyper#46 --- src/client/background.rs | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/src/client/background.rs b/src/client/background.rs index 3de8b24..4812acb 100644 --- a/src/client/background.rs +++ b/src/client/background.rs @@ -1,11 +1,10 @@ use futures::{Future, Poll}; use hyper::body::Payload; use hyper::client::conn::Connection as HyperConnection; +use log::error; use std::fmt::{self, Debug}; use tokio_io::{AsyncRead, AsyncWrite}; -use log::error; - /// Background task for a client connection. /// /// This type is not used directly by a user of this library, @@ -18,18 +17,6 @@ where connection: HyperConnection, } -impl Debug for Background -where - T: Debug + AsyncRead + AsyncWrite + Send + 'static, - B: Payload, -{ - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("Background") - .field("connection", &self.connection) - .finish() - } -} - impl Background where T: AsyncRead + AsyncWrite + Send + 'static, @@ -54,3 +41,15 @@ where }) } } + +impl Debug for Background +where + T: Debug + AsyncRead + AsyncWrite + Send + 'static, + B: Payload, +{ + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + f.debug_struct("Background") + .field("connection", &self.connection) + .finish() + } +}