Skip to content

Commit e3290d4

Browse files
committed
hyper 0.13 -> 0.14, tonic 0.2 -> 1.0
1 parent 56bc5ef commit e3290d4

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ license = "ISC"
1010

1111
[dependencies]
1212
anyhow = "1.0"
13-
futures-util = "0.3.1"
13+
futures-util = "0.3"
1414
hex = "0.4"
15-
hyper = { version = "0.13", features = ["stream"] }
16-
tokio = { version = "0.2", features = ["uds"] }
17-
pin-project = "0.4"
15+
hyper = { version = "0.14", features = ["full"] }
16+
tokio = { version = "1.0", features = ["net", "rt-multi-thread"] }
17+
pin-project = "1.0"

src/lib.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ use pin_project::pin_project;
1616
use std::borrow::Cow;
1717
use std::future::Future;
1818
use 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

162162
impl 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

166166
impl 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

Comments
 (0)