@@ -97,12 +97,12 @@ impl Sink<UdpMsg> for WriteHalf {
9797 fn poll_ready ( mut self : Pin < & mut Self > , cx : & mut Context < ' _ > ) -> Poll < Result < ( ) , Self :: Error > > {
9898 match ready ! ( self . stack_tx. poll_ready_unpin( cx) ) {
9999 Ok ( ( ) ) => Poll :: Ready ( Ok ( ( ) ) ) ,
100- Err ( err) => Poll :: Ready ( Err ( std:: io:: Error :: new ( std :: io :: ErrorKind :: Other , err) ) ) ,
100+ Err ( err) => Poll :: Ready ( Err ( std:: io:: Error :: other ( err) ) ) ,
101101 }
102102 }
103103
104104 fn start_send ( mut self : Pin < & mut Self > , item : UdpMsg ) -> Result < ( ) , Self :: Error > {
105- use std:: io:: { Error , ErrorKind :: InvalidData , ErrorKind :: Other } ;
105+ use std:: io:: { Error , ErrorKind :: InvalidData } ;
106106 let ( data, src_addr, dst_addr) = item;
107107
108108 if data. is_empty ( ) {
@@ -126,27 +126,27 @@ impl Sink<UdpMsg> for WriteHalf {
126126 let mut ip_packet_writer = Vec :: with_capacity ( builder. size ( data. len ( ) ) ) ;
127127 builder
128128 . write ( & mut ip_packet_writer, & data)
129- . map_err ( |err| Error :: new ( Other , format ! ( "PacketBuilder::write: {}" , err ) ) ) ?;
129+ . map_err ( |err| Error :: other ( format ! ( "PacketBuilder::write: {err}" ) ) ) ?;
130130
131131 match self . stack_tx . start_send_unpin ( ip_packet_writer. clone ( ) ) {
132132 Ok ( ( ) ) => Ok ( ( ) ) ,
133- Err ( err) => Err ( Error :: new ( Other , format ! ( "send error: {}" , err ) ) ) ,
133+ Err ( err) => Err ( Error :: other ( format ! ( "send error: {err}" ) ) ) ,
134134 }
135135 }
136136
137137 fn poll_flush ( mut self : Pin < & mut Self > , cx : & mut Context < ' _ > ) -> Poll < Result < ( ) , Self :: Error > > {
138- use std:: io:: { Error , ErrorKind :: Other } ;
138+ use std:: io:: Error ;
139139 match ready ! ( self . stack_tx. poll_flush_unpin( cx) ) {
140140 Ok ( ( ) ) => Poll :: Ready ( Ok ( ( ) ) ) ,
141- Err ( err) => Poll :: Ready ( Err ( Error :: new ( Other , format ! ( "flush error: {}" , err ) ) ) ) ,
141+ Err ( err) => Poll :: Ready ( Err ( Error :: other ( format ! ( "flush error: {err}" ) ) ) ) ,
142142 }
143143 }
144144
145145 fn poll_close ( mut self : Pin < & mut Self > , cx : & mut Context < ' _ > ) -> Poll < Result < ( ) , Self :: Error > > {
146- use std:: io:: { Error , ErrorKind :: Other } ;
146+ use std:: io:: Error ;
147147 match ready ! ( self . stack_tx. poll_close_unpin( cx) ) {
148148 Ok ( ( ) ) => Poll :: Ready ( Ok ( ( ) ) ) ,
149- Err ( err) => Poll :: Ready ( Err ( Error :: new ( Other , format ! ( "close error: {}" , err ) ) ) ) ,
149+ Err ( err) => Poll :: Ready ( Err ( Error :: other ( format ! ( "close error: {err}" ) ) ) ) ,
150150 }
151151 }
152152}
0 commit comments