diff --git a/tonic/src/client/grpc.rs b/tonic/src/client/grpc.rs index 80d164a..4f7b64b 100644 --- a/tonic/src/client/grpc.rs +++ b/tonic/src/client/grpc.rs @@ -63,7 +63,8 @@ impl Grpc { ::Data: Into, C: Codec, M1: Send + 'static, - M2: Send + 'static { + M2: Send + 'static, + { let request = request.map(|m| stream::once(future::ok(m))); self.client_streaming(request, path, codec).await } @@ -83,7 +84,7 @@ impl Grpc { S: Stream> + Send + 'static, C: Codec, M1: Send + 'static, - M2: Send + 'static + M2: Send + 'static, { let (mut parts, body) = self.streaming(request, path, codec).await?.into_parts(); @@ -115,7 +116,7 @@ impl Grpc { ::Data: Into, C: Codec, M1: Send + 'static, - M2: Send + 'static + M2: Send + 'static, { let request = request.map(|m| stream::once(future::ok(m))); self.streaming(request, path, codec).await @@ -136,7 +137,7 @@ impl Grpc { S: Stream> + Send + 'static, C: Codec, M1: Send + 'static, - M2: Send + 'static + M2: Send + 'static, { let mut parts = Parts::default(); parts.path_and_query = Some(path); diff --git a/tonic/src/codec/decode.rs b/tonic/src/codec/decode.rs index a29715d..b996d85 100644 --- a/tonic/src/codec/decode.rs +++ b/tonic/src/codec/decode.rs @@ -1,11 +1,15 @@ use super::Decoder; -use crate::{Code, Status, BoxBody, metadata::MetadataMap}; +use crate::{metadata::MetadataMap, BoxBody, Code, Status}; use bytes::{Buf, BufMut, Bytes, BytesMut, IntoBuf}; use futures_core::Stream; use futures_util::{future, ready}; use http::StatusCode; use http_body::Body; -use std::{fmt, pin::Pin, task::{Context, Poll}}; +use std::{ + fmt, + pin::Pin, + task::{Context, Poll}, +}; use tracing::{debug, trace}; /// Streaming requests and responses. @@ -110,10 +114,9 @@ impl Streaming { // Trailers were not caught during poll_next and thus lets poll for // them manually. - let map = - future::poll_fn(|cx| Pin::new(&mut self.body).poll_trailers(cx)) - .await - .map_err(|e| Status::from_error(&e))?; + let map = future::poll_fn(|cx| Pin::new(&mut self.body).poll_trailers(cx)) + .await + .map_err(|e| Status::from_error(&e))?; Ok(map.map(MetadataMap::from_headers)) }