Skip to content

Commit

Permalink
tonic: move mapping responsibility to caller
Browse files Browse the repository at this point in the history
  • Loading branch information
djc committed Sep 21, 2024
1 parent 4b5415f commit 168ba46
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion tonic/src/client/grpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ impl<T> Grpc<T> {
.map(|s| {
encode_client(
codec.encoder(),
s,
s.map(Ok),
self.config.send_compression_encodings,
self.config.max_encoding_message_size,
)
Expand Down
6 changes: 3 additions & 3 deletions tonic/src/codec/encode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ pub fn encode_client<T, U>(
source: U,
compression_encoding: Option<CompressionEncoding>,
max_message_size: Option<usize>,
) -> EncodeBody<T, impl Stream<Item = Result<T::Item, Status>>>
) -> EncodeBody<T, U>
where
T: Encoder<Error = Status>,
U: Stream<Item = T::Item>,
U: Stream,
{
let stream = EncodedBytes::new(
encoder,
source.map(Ok),
source,
compression_encoding,
SingleMessageCompressionOverride::default(),
max_message_size,
Expand Down

0 comments on commit 168ba46

Please sign in to comment.