Skip to content

Commit f6ac142

Browse files
committed
tokio: fix windows build
1 parent 6c5bf68 commit f6ac142

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/implementors/tokio.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use std::{
1111
task::{Context, Poll},
1212
time::{Duration, Instant},
1313
};
14-
use tokio::{io::unix::AsyncFd, net::TcpStream, runtime::Handle};
14+
use tokio::{net::TcpStream, runtime::Handle};
1515
use tokio_stream::{StreamExt, wrappers::IntervalStream};
1616
use tokio_util::compat::TokioAsyncReadCompatExt;
1717

@@ -118,7 +118,9 @@ impl Reactor for Tokio {
118118
) -> io::Result<impl AsyncIOHandle + Send> {
119119
let _enter = self.handle().as_ref().map(|handle| handle.enter());
120120
if cfg!(unix) {
121-
Ok(Box::new(unix::AsyncFdWrapper(AsyncFd::new(socket)?)))
121+
Ok(Box::new(unix::AsyncFdWrapper(
122+
tokio::io::unix::AsyncFd::new(socket)?,
123+
)))
122124
} else {
123125
Err(io::Error::other(
124126
"Registering FD on tokio reactor is only supported on unix",
@@ -149,6 +151,7 @@ mod unix {
149151
use super::*;
150152
use futures_io::{AsyncRead, AsyncWrite};
151153
use std::io::{IoSlice, IoSliceMut, Read, Write};
154+
use tokio::io::unix::AsyncFd;
152155

153156
pub(super) struct AsyncFdWrapper<H: IO + Send + 'static>(pub(super) AsyncFd<IOHandle<H>>);
154157

0 commit comments

Comments
 (0)