@@ -647,7 +647,6 @@ impl<T> Async<T> {
647
647
pub async fn write_with < R > ( & self , op : impl FnMut ( & T ) -> io:: Result < R > ) -> io:: Result < R > {
648
648
let mut op = op;
649
649
loop {
650
- future:: poll_fn ( |cx| maybe_yield ( cx) ) . await ;
651
650
match op ( self . get_ref ( ) ) {
652
651
Err ( err) if err. kind ( ) == io:: ErrorKind :: WouldBlock => { }
653
652
res => return res,
@@ -685,7 +684,6 @@ impl<T> Async<T> {
685
684
) -> io:: Result < R > {
686
685
let mut op = op;
687
686
loop {
688
- future:: poll_fn ( |cx| maybe_yield ( cx) ) . await ;
689
687
match op ( self . get_mut ( ) ) {
690
688
Err ( err) if err. kind ( ) == io:: ErrorKind :: WouldBlock => { }
691
689
res => return res,
@@ -776,7 +774,6 @@ impl<T: Write> AsyncWrite for Async<T> {
776
774
cx : & mut Context < ' _ > ,
777
775
buf : & [ u8 ] ,
778
776
) -> Poll < io:: Result < usize > > {
779
- ready ! ( maybe_yield( cx) ) ;
780
777
match ( & mut * self ) . get_mut ( ) . write ( buf) {
781
778
Err ( err) if err. kind ( ) == io:: ErrorKind :: WouldBlock => { }
782
779
res => return Poll :: Ready ( res) ,
@@ -790,7 +787,6 @@ impl<T: Write> AsyncWrite for Async<T> {
790
787
cx : & mut Context < ' _ > ,
791
788
bufs : & [ IoSlice < ' _ > ] ,
792
789
) -> Poll < io:: Result < usize > > {
793
- ready ! ( maybe_yield( cx) ) ;
794
790
match ( & mut * self ) . get_mut ( ) . write_vectored ( bufs) {
795
791
Err ( err) if err. kind ( ) == io:: ErrorKind :: WouldBlock => { }
796
792
res => return Poll :: Ready ( res) ,
@@ -800,7 +796,6 @@ impl<T: Write> AsyncWrite for Async<T> {
800
796
}
801
797
802
798
fn poll_flush ( mut self : Pin < & mut Self > , cx : & mut Context < ' _ > ) -> Poll < io:: Result < ( ) > > {
803
- ready ! ( maybe_yield( cx) ) ;
804
799
match ( & mut * self ) . get_mut ( ) . flush ( ) {
805
800
Err ( err) if err. kind ( ) == io:: ErrorKind :: WouldBlock => { }
806
801
res => return Poll :: Ready ( res) ,
@@ -823,7 +818,6 @@ where
823
818
cx : & mut Context < ' _ > ,
824
819
buf : & [ u8 ] ,
825
820
) -> Poll < io:: Result < usize > > {
826
- ready ! ( maybe_yield( cx) ) ;
827
821
match ( & * self ) . get_ref ( ) . write ( buf) {
828
822
Err ( err) if err. kind ( ) == io:: ErrorKind :: WouldBlock => { }
829
823
res => return Poll :: Ready ( res) ,
@@ -837,7 +831,6 @@ where
837
831
cx : & mut Context < ' _ > ,
838
832
bufs : & [ IoSlice < ' _ > ] ,
839
833
) -> Poll < io:: Result < usize > > {
840
- ready ! ( maybe_yield( cx) ) ;
841
834
match ( & * self ) . get_ref ( ) . write_vectored ( bufs) {
842
835
Err ( err) if err. kind ( ) == io:: ErrorKind :: WouldBlock => { }
843
836
res => return Poll :: Ready ( res) ,
@@ -847,7 +840,6 @@ where
847
840
}
848
841
849
842
fn poll_flush ( self : Pin < & mut Self > , cx : & mut Context < ' _ > ) -> Poll < io:: Result < ( ) > > {
850
- ready ! ( maybe_yield( cx) ) ;
851
843
match ( & * self ) . get_ref ( ) . flush ( ) {
852
844
Err ( err) if err. kind ( ) == io:: ErrorKind :: WouldBlock => { }
853
845
res => return Poll :: Ready ( res) ,
0 commit comments