@@ -2,7 +2,6 @@ use crate::{
22 error:: { Error , Result } ,
33 protocol:: { Address , AddressType , AsyncStreamOperation , AuthMethod , Command , Reply , StreamOperation , UserKey , Version } ,
44} ;
5- use async_trait:: async_trait;
65use std:: {
76 fmt:: Debug ,
87 io:: Cursor ,
@@ -14,7 +13,7 @@ use tokio::{
1413 net:: { TcpStream , UdpSocket } ,
1514} ;
1615
17- #[ async_trait]
16+ #[ async_trait:: async_trait ]
1817pub trait Socks5Reader : AsyncReadExt + Unpin {
1918 async fn read_version ( & mut self ) -> Result < ( ) > {
2019 let value = Version :: try_from ( self . read_u8 ( ) . await ?) ?;
@@ -109,10 +108,10 @@ pub trait Socks5Reader: AsyncReadExt + Unpin {
109108 }
110109}
111110
112- #[ async_trait]
111+ #[ async_trait:: async_trait ]
113112impl < T : AsyncReadExt + Unpin > Socks5Reader for T { }
114113
115- #[ async_trait]
114+ #[ async_trait:: async_trait ]
116115pub trait Socks5Writer : AsyncWriteExt + Unpin {
117116 async fn write_version ( & mut self ) -> Result < ( ) > {
118117 self . write_u8 ( 0x05 ) . await ?;
@@ -189,7 +188,7 @@ pub trait Socks5Writer: AsyncWriteExt + Unpin {
189188 }
190189}
191190
192- #[ async_trait]
191+ #[ async_trait:: async_trait ]
193192impl < T : AsyncWriteExt + Unpin > Socks5Writer for T { }
194193
195194async fn username_password_auth < S > ( stream : & mut S , auth : & UserKey ) -> Result < ( ) >
@@ -426,7 +425,7 @@ where
426425pub type GuardTcpStream = BufStream < TcpStream > ;
427426pub type SocksUdpClient = SocksDatagram < GuardTcpStream > ;
428427
429- #[ async_trait]
428+ #[ async_trait:: async_trait ]
430429pub trait UdpClientTrait {
431430 async fn send_to < A > ( & mut self , buf : & [ u8 ] , addr : A ) -> Result < usize >
432431 where
@@ -435,7 +434,7 @@ pub trait UdpClientTrait {
435434 async fn recv_from ( & mut self , timeout : Duration , buf : & mut Vec < u8 > ) -> Result < ( usize , Address ) > ;
436435}
437436
438- #[ async_trait]
437+ #[ async_trait:: async_trait ]
439438impl UdpClientTrait for SocksUdpClient {
440439 async fn send_to < A > ( & mut self , buf : & [ u8 ] , addr : A ) -> Result < usize , Error >
441440 where
@@ -494,7 +493,6 @@ mod tests {
494493 client:: { self , SocksListener , SocksUdpClient , UdpClientTrait } ,
495494 protocol:: { Address , UserKey } ,
496495 } ;
497- use async_trait:: async_trait;
498496 use std:: {
499497 net:: { SocketAddr , ToSocketAddrs } ,
500498 sync:: Arc ,
@@ -563,7 +561,7 @@ mod tests {
563561
564562 type TestHalves = ( Arc < SocksUdpClient > , Arc < SocksUdpClient > ) ;
565563
566- #[ async_trait]
564+ #[ async_trait:: async_trait ]
567565 impl UdpClientTrait for TestHalves {
568566 async fn send_to < A > ( & mut self , buf : & [ u8 ] , addr : A ) -> Result < usize , Error >
569567 where
0 commit comments