We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
size_hint
is_end_stream
Empty
1 parent e5bd0d1 commit f73c13cCopy full SHA for f73c13c
CHANGELOG.md
@@ -1,6 +1,6 @@
1
# Unreleased
2
3
-Nothing.
+- Correctly override `Body::size_hint` and `Body::is_end_stream` for `Empty`.
4
5
# 0.4.1 (March 18, 2021)
6
src/empty.rs
@@ -1,4 +1,4 @@
-use super::Body;
+use super::{Body, SizeHint};
use bytes::Buf;
use http::HeaderMap;
use std::{
@@ -40,6 +40,14 @@ impl<D: Buf> Body for Empty<D> {
40
) -> Poll<Result<Option<HeaderMap>, Self::Error>> {
41
Poll::Ready(Ok(None))
42
}
43
+
44
+ fn is_end_stream(&self) -> bool {
45
+ true
46
+ }
47
48
+ fn size_hint(&self) -> SizeHint {
49
+ SizeHint::with_exact(0)
50
51
52
53
impl<D> fmt::Debug for Empty<D> {
0 commit comments