Skip to content

Commit 46ee628

Browse files
Ludeaikrivosheev
authored andcommitted
add poll_frame, delete poll_trailers
1 parent cd05673 commit 46ee628

File tree

1 file changed

+6
-18
lines changed

1 file changed

+6
-18
lines changed

tonic/src/transport/server/recover_error.rs

+6-18
Original file line numberDiff line numberDiff line change
@@ -98,30 +98,18 @@ where
9898
type Data = B::Data;
9999
type Error = B::Error;
100100

101-
fn poll_data(
101+
fn poll_frame(
102102
self: Pin<&mut Self>,
103103
cx: &mut Context<'_>,
104-
) -> Poll<Option<Result<Self::Data, Self::Error>>> {
105-
match self.project().inner.as_pin_mut() {
106-
Some(b) => b.poll_data(cx),
107-
None => Poll::Ready(None),
108-
}
104+
) -> Poll<Option<Result<http_body::Frame<Self::Data>, Self::Error>>> {
105+
Pin::new(&mut self.0).poll_frame(cx)
109106
}
110107

111-
fn poll_trailers(
112-
self: Pin<&mut Self>,
113-
cx: &mut Context<'_>,
114-
) -> Poll<Result<Option<http::HeaderMap>, Self::Error>> {
115-
match self.project().inner.as_pin_mut() {
116-
Some(b) => b.poll_trailers(cx),
117-
None => Poll::Ready(Ok(None)),
118-
}
108+
fn size_hint(&self) -> http_body::SizeHint {
109+
self.0.size_hint()
119110
}
120111

121112
fn is_end_stream(&self) -> bool {
122-
match &self.inner {
123-
Some(b) => b.is_end_stream(),
124-
None => true,
125-
}
113+
self.body.is_end_stream()
126114
}
127115
}

0 commit comments

Comments
 (0)