diff --git a/tonic-web/src/client.rs b/tonic-web/src/client.rs index 69d367fd2..98a4032e0 100644 --- a/tonic-web/src/client.rs +++ b/tonic-web/src/client.rs @@ -1,6 +1,7 @@ use http::header::CONTENT_TYPE; use http::{Request, Response, Version}; use pin_project::pin_project; +use std::fmt; use std::future::Future; use std::pin::Pin; use std::task::{ready, Context, Poll}; @@ -78,7 +79,6 @@ where } /// Response future for the [`GrpcWebService`]. -#[allow(missing_debug_implementations)] #[pin_project] #[must_use = "futures do nothing unless polled"] pub struct ResponseFuture { @@ -98,3 +98,9 @@ where Poll::Ready(res.map(|r| r.map(GrpcWebCall::client_response))) } } + +impl fmt::Debug for ResponseFuture { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + f.debug_struct("ResponseFuture").finish() + } +} diff --git a/tonic-web/src/service.rs b/tonic-web/src/service.rs index 54938d7f7..ca2a43d5b 100644 --- a/tonic-web/src/service.rs +++ b/tonic-web/src/service.rs @@ -130,7 +130,6 @@ where } /// Response future for the [`GrpcWebService`]. -#[allow(missing_debug_implementations)] #[pin_project] #[must_use = "futures do nothing unless polled"] pub struct ResponseFuture { @@ -179,6 +178,12 @@ impl NamedService for GrpcWebService { const NAME: &'static str = S::NAME; } +impl fmt::Debug for ResponseFuture { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + f.debug_struct("ResponseFuture").finish() + } +} + impl<'a> RequestKind<'a> { fn new(headers: &'a HeaderMap, method: &'a Method, version: Version) -> Self { if is_grpc_web(headers) {