File tree Expand file tree Collapse file tree 2 files changed +1
-19
lines changed Expand file tree Collapse file tree 2 files changed +1
-19
lines changed Original file line number Diff line number Diff line change @@ -224,24 +224,6 @@ impl Body {
224224 Body :: new ( Kind :: Wrapped ( Box :: new ( mapped) ) )
225225 }
226226
227- /// Returns if this body was constructed via `Body::empty()`.
228- ///
229- /// # Note
230- ///
231- /// This does **not** detect if the body stream may be at the end, or
232- /// if the stream will not yield any chunks, in all cases. For instance,
233- /// a streaming body using `chunked` encoding is not able to tell if
234- /// there are more chunks immediately.
235- ///
236- /// See [`is_end_stream`](Payload::is_end_stream) for a dynamic version.
237- #[ inline]
238- pub fn is_empty ( & self ) -> bool {
239- match self . kind {
240- Kind :: Empty => true ,
241- _ => false ,
242- }
243- }
244-
245227 fn new ( kind : Kind ) -> Body {
246228 Body {
247229 kind : kind,
Original file line number Diff line number Diff line change @@ -370,7 +370,7 @@ where C: Connect + Sync + 'static,
370370 // It won't be ready if there is a body to stream.
371371 if ver == Ver :: Http2 || !pooled. is_pool_enabled ( ) || pooled. is_ready ( ) {
372372 drop ( pooled) ;
373- } else if !res. body ( ) . is_empty ( ) {
373+ } else if !res. body ( ) . is_end_stream ( ) {
374374 let ( delayed_tx, delayed_rx) = oneshot:: channel ( ) ;
375375 res. body_mut ( ) . delayed_eof ( delayed_rx) ;
376376 executor. execute (
You can’t perform that action at this time.
0 commit comments