fix(build): fix with_interceptor not building on Rust 1.51 (#669)

Fixes https://github.com/hyperium/tonic/issues/666
This commit is contained in:
David Pedersen
2021-05-27 15:47:42 +02:00
committed by GitHub
parent 32173dc7f6
commit 9478fac979
+4 -1
View File
@@ -50,7 +50,10 @@ pub fn generate<T: Service>(
pub fn with_interceptor<F>(inner: T, interceptor: F) -> #service_ident<InterceptedService<T, F>>
where
F: FnMut(tonic::Request<()>) -> Result<tonic::Request<()>, tonic::Status>,
T: Service<http::Request<tonic::body::BoxBody>, Response = http::Response<T::ResponseBody>>,
T: Service<
http::Request<tonic::body::BoxBody>,
Response = http::Response<<T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody>
>,
<T as Service<http::Request<tonic::body::BoxBody>>>::Error: Into<StdError> + Send + Sync,
{
#service_ident::new(InterceptedService::new(inner, interceptor))