perf(http2): improve Body::is_end_stream detection for http2

This commit is contained in:
Sean McArthur
2018-04-18 16:42:55 -07:00
parent 1328412f82
commit 4ea5472f90

View File

@@ -318,7 +318,7 @@ impl Payload for Body {
fn is_end_stream(&self) -> bool {
match self.kind {
Kind::Chan { .. } => false,
Kind::H2(..) => false,
Kind::H2(ref h2) => h2.is_end_stream(),
Kind::Wrapped(..) => false,
Kind::Once(ref val) => val.is_none(),
Kind::Empty => true