@@ -10,12 +10,12 @@ use core::{
1010 pin:: Pin ,
1111 task:: { Context , Poll } ,
1212} ;
13- use futures_util:: future:: { FutureExt , TryFutureExt } ;
1413use hex:: FromHex ;
1514use pin_project:: pin_project;
1615use std:: borrow:: Cow ;
1716use std:: future:: Future ;
1817use std:: path:: Path ;
18+ use tokio:: io:: ReadBuf ;
1919
2020/// A type which implements `Into` for hyper's [`hyper::Uri`] type
2121/// targetting unix domain sockets.
@@ -120,16 +120,14 @@ impl hyper::server::accept::Accept for UnixConnector {
120120 type Error = Error ;
121121
122122 fn poll_accept (
123- mut self : Pin < & mut Self > ,
123+ self : Pin < & mut Self > ,
124124 cx : & mut Context ,
125125 ) -> Poll < Option < Result < Self :: Conn , Self :: Error > > > {
126- let fut = self
127- . 0
128- . accept ( )
126+ self . 0
127+ . poll_accept ( cx)
129128 . map_ok ( |( stream, _addr) | stream)
130129 . map_err ( |e| e. into ( ) )
131- . map ( |f| Some ( f) ) ;
132- Future :: poll ( Box :: pin ( fut) . as_mut ( ) , cx)
130+ . map ( |f| Some ( f) )
133131 }
134132}
135133
@@ -160,7 +158,7 @@ macro_rules! conn_impl_fn {
160158}
161159
162160impl tokio:: io:: AsyncRead for UDS {
163- conn_impl_fn ! ( poll_read |self : Pin <& mut Self >, cx: & mut Context <' _>, buf: & mut [ u8 ] | -> Poll <std:: io:: Result <usize >> ; ; ) ;
161+ conn_impl_fn ! ( poll_read |self : Pin <& mut Self >, cx: & mut Context <' _>, buf: & mut ReadBuf < ' _> | -> Poll <std:: io:: Result <( ) >> ; ; ) ;
164162}
165163
166164impl tokio:: io:: AsyncWrite for UDS {
@@ -235,7 +233,9 @@ mod test {
235233
236234 std:: fs:: remove_file ( TEST_UNIX_ADDR ) . unwrap_or_else ( |_| ( ) ) ;
237235
238- let mut rt = tokio:: runtime:: Runtime :: new ( ) ?;
236+ let rt = tokio:: runtime:: Builder :: new_multi_thread ( )
237+ . enable_all ( )
238+ . build ( ) ?;
239239 rt. block_on ( async {
240240 // server
241241 let uc: UnixConnector = tokio:: net:: UnixListener :: bind ( TEST_UNIX_ADDR )
0 commit comments