@@ -2,6 +2,9 @@ use std::borrow::Cow;
22#[ cfg( feature = "stream" ) ]
33use std:: error:: Error as StdError ;
44use std:: fmt;
5+ use std:: future:: Future ;
6+ use std:: pin:: Pin ;
7+ use std:: task:: { Context , Poll } ;
58
69use bytes:: Bytes ;
710use futures_channel:: mpsc;
@@ -15,10 +18,9 @@ use http_body::{Body as HttpBody, SizeHint};
1518use super :: DecodedLength ;
1619#[ cfg( feature = "stream" ) ]
1720use crate :: common:: sync_wrapper:: SyncWrapper ;
18- use crate :: common:: Future ;
21+ use crate :: common:: watch ;
1922#[ cfg( all( feature = "client" , any( feature = "http1" , feature = "http2" ) ) ) ]
2023use crate :: common:: Never ;
21- use crate :: common:: { task, watch, Pin , Poll } ;
2224#[ cfg( all( feature = "http2" , any( feature = "client" , feature = "server" ) ) ) ]
2325use crate :: proto:: h2:: ping;
2426
@@ -239,7 +241,7 @@ impl Body {
239241 . get_or_insert_with ( || Box :: new ( Extra { delayed_eof : None } ) )
240242 }
241243
242- fn poll_eof ( & mut self , cx : & mut task :: Context < ' _ > ) -> Poll < Option < crate :: Result < Bytes > > > {
244+ fn poll_eof ( & mut self , cx : & mut Context < ' _ > ) -> Poll < Option < crate :: Result < Bytes > > > {
243245 match self . take_delayed_eof ( ) {
244246 #[ cfg( any( feature = "http1" , feature = "http2" ) ) ]
245247 #[ cfg( feature = "client" ) ]
@@ -292,7 +294,7 @@ impl Body {
292294 }
293295 }
294296
295- fn poll_inner ( & mut self , cx : & mut task :: Context < ' _ > ) -> Poll < Option < crate :: Result < Bytes > > > {
297+ fn poll_inner ( & mut self , cx : & mut Context < ' _ > ) -> Poll < Option < crate :: Result < Bytes > > > {
296298 match self . kind {
297299 Kind :: Once ( ref mut val) => Poll :: Ready ( val. take ( ) . map ( Ok ) ) ,
298300 Kind :: Chan {
@@ -367,14 +369,14 @@ impl HttpBody for Body {
367369
368370 fn poll_data (
369371 mut self : Pin < & mut Self > ,
370- cx : & mut task :: Context < ' _ > ,
372+ cx : & mut Context < ' _ > ,
371373 ) -> Poll < Option < Result < Self :: Data , Self :: Error > > > {
372374 self . poll_eof ( cx)
373375 }
374376
375377 fn poll_trailers (
376378 #[ cfg_attr( not( feature = "http2" ) , allow( unused_mut) ) ] mut self : Pin < & mut Self > ,
377- #[ cfg_attr( not( feature = "http2" ) , allow( unused) ) ] cx : & mut task :: Context < ' _ > ,
379+ #[ cfg_attr( not( feature = "http2" ) , allow( unused) ) ] cx : & mut Context < ' _ > ,
378380 ) -> Poll < Result < Option < HeaderMap > , Self :: Error > > {
379381 match self . kind {
380382 #[ cfg( all( feature = "http2" , any( feature = "client" , feature = "server" ) ) ) ]
@@ -470,7 +472,7 @@ impl fmt::Debug for Body {
470472impl Stream for Body {
471473 type Item = crate :: Result < Bytes > ;
472474
473- fn poll_next ( self : Pin < & mut Self > , cx : & mut task :: Context < ' _ > ) -> Poll < Option < Self :: Item > > {
475+ fn poll_next ( self : Pin < & mut Self > , cx : & mut Context < ' _ > ) -> Poll < Option < Self :: Item > > {
474476 HttpBody :: poll_data ( self , cx)
475477 }
476478}
@@ -550,15 +552,15 @@ impl From<Cow<'static, str>> for Body {
550552
551553impl Sender {
552554 /// Check to see if this `Sender` can send more data.
553- pub fn poll_ready ( & mut self , cx : & mut task :: Context < ' _ > ) -> Poll < crate :: Result < ( ) > > {
555+ pub fn poll_ready ( & mut self , cx : & mut Context < ' _ > ) -> Poll < crate :: Result < ( ) > > {
554556 // Check if the receiver end has tried polling for the body yet
555557 ready ! ( self . poll_want( cx) ?) ;
556558 self . data_tx
557559 . poll_ready ( cx)
558560 . map_err ( |_| crate :: Error :: new_closed ( ) )
559561 }
560562
561- fn poll_want ( & mut self , cx : & mut task :: Context < ' _ > ) -> Poll < crate :: Result < ( ) > > {
563+ fn poll_want ( & mut self , cx : & mut Context < ' _ > ) -> Poll < crate :: Result < ( ) > > {
562564 match self . want_rx . load ( cx) {
563565 WANT_READY => Poll :: Ready ( Ok ( ( ) ) ) ,
564566 WANT_PENDING => Poll :: Pending ,
0 commit comments