diff --git a/src/client/request.rs b/src/client/request.rs index aff4ab485..76fb1be59 100644 --- a/src/client/request.rs +++ b/src/client/request.rs @@ -254,16 +254,16 @@ impl ClientRequest { impl fmt::Debug for ClientRequest { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - let res = writeln!( + writeln!( f, "\nClientRequest {:?} {}:{}", self.version, self.method, self.uri - ); - let _ = writeln!(f, " headers:"); + )?; + writeln!(f, " headers:")?; for (key, val) in self.headers.iter() { - let _ = writeln!(f, " {:?}: {:?}", key, val); + writeln!(f, " {:?}: {:?}", key, val)?; } - res + Ok(()) } } @@ -750,16 +750,16 @@ fn parts<'a>( impl fmt::Debug for ClientRequestBuilder { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { if let Some(ref parts) = self.request { - let res = writeln!( + writeln!( f, "\nClientRequestBuilder {:?} {}:{}", parts.version, parts.method, parts.uri - ); - let _ = writeln!(f, " headers:"); + )?; + writeln!(f, " headers:")?; for (key, val) in parts.headers.iter() { - let _ = writeln!(f, " {:?}: {:?}", key, val); + writeln!(f, " {:?}: {:?}", key, val)?; } - res + Ok(()) } else { write!(f, "ClientRequestBuilder(Consumed)") } diff --git a/src/client/response.rs b/src/client/response.rs index 0c094a2aa..5f1f42649 100644 --- a/src/client/response.rs +++ b/src/client/response.rs @@ -95,12 +95,12 @@ impl ClientResponse { impl fmt::Debug for ClientResponse { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - let res = writeln!(f, "\nClientResponse {:?} {}", self.version(), self.status()); - let _ = writeln!(f, " headers:"); + writeln!(f, "\nClientResponse {:?} {}", self.version(), self.status())?; + writeln!(f, " headers:")?; for (key, val) in self.headers().iter() { - let _ = writeln!(f, " {:?}: {:?}", key, val); + writeln!(f, " {:?}: {:?}", key, val)?; } - res + Ok(()) } } diff --git a/src/httprequest.rs b/src/httprequest.rs index f4de81529..d8c49496a 100644 --- a/src/httprequest.rs +++ b/src/httprequest.rs @@ -354,24 +354,24 @@ impl FromRequest for HttpRequest { impl fmt::Debug for HttpRequest { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - let res = writeln!( + writeln!( f, "\nHttpRequest {:?} {}:{}", self.version(), self.method(), self.path() - ); + )?; if !self.query_string().is_empty() { - let _ = writeln!(f, " query: ?{:?}", self.query_string()); + writeln!(f, " query: ?{:?}", self.query_string())?; } if !self.match_info().is_empty() { - let _ = writeln!(f, " params: {:?}", self.match_info()); + writeln!(f, " params: {:?}", self.match_info())?; } - let _ = writeln!(f, " headers:"); + writeln!(f, " headers:")?; for (key, val) in self.headers().iter() { - let _ = writeln!(f, " {:?}: {:?}", key, val); + writeln!(f, " {:?}: {:?}", key, val)?; } - res + Ok(()) } } diff --git a/src/multipart.rs b/src/multipart.rs index fe809294f..862f60ecb 100644 --- a/src/multipart.rs +++ b/src/multipart.rs @@ -441,13 +441,13 @@ where impl fmt::Debug for Field { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - let res = writeln!(f, "\nMultipartField: {}", self.ct); - let _ = writeln!(f, " boundary: {}", self.inner.borrow().boundary); - let _ = writeln!(f, " headers:"); + writeln!(f, "\nMultipartField: {}", self.ct)?; + writeln!(f, " boundary: {}", self.inner.borrow().boundary)?; + writeln!(f, " headers:")?; for (key, val) in self.headers.iter() { - let _ = writeln!(f, " {:?}: {:?}", key, val); + writeln!(f, " {:?}: {:?}", key, val)?; } - res + Ok(()) } }