From 9478fac97984cf8291bf89c55eb9a02a06889e03 Mon Sep 17 00:00:00 2001 From: David Pedersen Date: Thu, 27 May 2021 15:47:42 +0200 Subject: [PATCH] fix(build): fix `with_interceptor` not building on Rust 1.51 (#669) Fixes https://github.com/hyperium/tonic/issues/666 --- tonic-build/src/client.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tonic-build/src/client.rs b/tonic-build/src/client.rs index 67b4792c5..be7d4247b 100644 --- a/tonic-build/src/client.rs +++ b/tonic-build/src/client.rs @@ -50,7 +50,10 @@ pub fn generate( pub fn with_interceptor(inner: T, interceptor: F) -> #service_ident> where F: FnMut(tonic::Request<()>) -> Result, tonic::Status>, - T: Service, Response = http::Response>, + T: Service< + http::Request, + Response = http::Response<>::ResponseBody> + >, >>::Error: Into + Send + Sync, { #service_ident::new(InterceptedService::new(inner, interceptor))