File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ use futures_core:: ready;
12use futures_sink:: Sink ;
23
34use pin_project_lite:: pin_project;
@@ -98,19 +99,11 @@ where
9899 buf : & [ u8 ] ,
99100 ) -> Poll < Result < usize , io:: Error > > {
100101 let mut this = self . project ( ) ;
101- match this. inner . as_mut ( ) . poll_ready ( cx) {
102- Poll :: Ready ( Ok ( ( ) ) ) => {
103- if let Err ( e) = this. inner . as_mut ( ) . start_send ( buf) {
104- Poll :: Ready ( Err ( e. into ( ) ) )
105- } else {
106- Poll :: Ready ( Ok ( buf. len ( ) ) )
107- }
108- }
109- Poll :: Ready ( Err ( e) ) => Poll :: Ready ( Err ( e. into ( ) ) ) ,
110- Poll :: Pending => {
111- cx. waker ( ) . wake_by_ref ( ) ;
112- Poll :: Pending
113- }
102+
103+ ready ! ( this. inner. as_mut( ) . poll_ready( cx) . map_err( Into :: into) ) ?;
104+ match this. inner . as_mut ( ) . start_send ( buf) {
105+ Ok ( ( ) ) => Poll :: Ready ( Ok ( buf. len ( ) ) ) ,
106+ Err ( e) => Poll :: Ready ( Err ( e. into ( ) ) ) ,
114107 }
115108 }
116109
You can’t perform that action at this time.
0 commit comments