@@ -16,6 +16,7 @@ use pin_project::pin_project;
1616use std:: borrow:: Cow ;
1717use std:: future:: Future ;
1818use std:: path:: Path ;
19+ use tokio:: io:: ReadBuf ;
1920
2021/// A type which implements `Into` for hyper's [`hyper::Uri`] type
2122/// targetting unix domain sockets.
@@ -120,16 +121,15 @@ impl hyper::server::accept::Accept for UnixConnector {
120121 type Error = Error ;
121122
122123 fn poll_accept (
123- mut self : Pin < & mut Self > ,
124+ self : Pin < & mut Self > ,
124125 cx : & mut Context ,
125126 ) -> Poll < Option < Result < Self :: Conn , Self :: Error > > > {
126- let fut = self
127+ self
127128 . 0
128- . accept ( )
129+ . poll_accept ( cx )
129130 . map_ok ( |( stream, _addr) | stream)
130131 . map_err ( |e| e. into ( ) )
131- . map ( |f| Some ( f) ) ;
132- Future :: poll ( Box :: pin ( fut) . as_mut ( ) , cx)
132+ . map ( |f| Some ( f) )
133133 }
134134}
135135
@@ -160,7 +160,7 @@ macro_rules! conn_impl_fn {
160160}
161161
162162impl 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 >> ; ; ) ;
163+ conn_impl_fn ! ( poll_read |self : Pin <& mut Self >, cx: & mut Context <' _>, buf: & mut ReadBuf < ' _> | -> Poll <std:: io:: Result <( ) >> ; ; ) ;
164164}
165165
166166impl tokio:: io:: AsyncWrite for UDS {
@@ -235,7 +235,7 @@ mod test {
235235
236236 std:: fs:: remove_file ( TEST_UNIX_ADDR ) . unwrap_or_else ( |_| ( ) ) ;
237237
238- let mut rt = tokio:: runtime:: Runtime :: new ( ) ?;
238+ let rt = tokio:: runtime:: Builder :: new_multi_thread ( ) . enable_all ( ) . build ( ) ?;
239239 rt. block_on ( async {
240240 // server
241241 let uc: UnixConnector = tokio:: net:: UnixListener :: bind ( TEST_UNIX_ADDR )
0 commit comments