Skip to content

Commit d71be5d

Browse files
author
Stjepan Glavina
committed
Reduce the number of dependencies
1 parent a1c77a6 commit d71be5d

File tree

4 files changed

+14
-17
lines changed

4 files changed

+14
-17
lines changed

Cargo.toml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,20 @@ readme = "README.md"
1515
[dependencies]
1616
cfg-if = "0.1.10"
1717
concurrent-queue = "1.1.1"
18-
futures-io = { version = "0.3.5", default-features = false, features = ["std"] }
19-
futures-util = { version = "0.3.5", default-features = false, features = ["std", "io"] }
20-
libc = "0.2.71"
18+
futures-lite = "0.1.3"
19+
libc = "0.2.72"
2120
once_cell = "1.4.0"
22-
parking = "1.0.3"
21+
parking = "1.0.5"
2322
socket2 = { version = "0.3.12", features = ["pair", "unix"] }
2423
vec-arena = "0.5.0"
2524

2625
[target.'cfg(windows)'.dependencies]
2726
wepoll-sys-stjepang = "1.0.6"
28-
winapi = { version = "0.3.8", features = ["ioapiset"] }
27+
winapi = { version = "0.3.9", features = ["ioapiset"] }
2928

3029
[dev-dependencies]
3130
async-channel = "1.1.1"
32-
async-dup = "1.1.0"
33-
blocking = "0.4.6"
31+
async-dup = "1.2.1"
32+
blocking = "0.4.7"
3433
futures = { version = "0.3.5", default-features = false, features = ["std"] }
3534
tempfile = "3.1.0"

src/lib.rs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,7 @@ use std::{
2626
path::Path,
2727
};
2828

29-
use futures_io::{AsyncRead, AsyncWrite};
30-
use futures_util::future;
31-
use futures_util::stream::{self, Stream};
29+
use futures_lite::*;
3230
use socket2::{Domain, Protocol, Socket, Type};
3331

3432
use crate::parking::{Reactor, Source};
@@ -431,7 +429,7 @@ impl<T> Async<T> {
431429
Err(err) if err.kind() == io::ErrorKind::WouldBlock => {}
432430
res => return Poll::Ready(res),
433431
}
434-
futures_util::ready!(poll_once(cx, self.readable()))?;
432+
ready!(poll_once(cx, self.readable()))?;
435433
Poll::Pending
436434
})
437435
.await
@@ -469,7 +467,7 @@ impl<T> Async<T> {
469467
Err(err) if err.kind() == io::ErrorKind::WouldBlock => {}
470468
res => return Poll::Ready(res),
471469
}
472-
futures_util::ready!(poll_once(cx, self.readable()))?;
470+
ready!(poll_once(cx, self.readable()))?;
473471
Poll::Pending
474472
})
475473
.await
@@ -505,7 +503,7 @@ impl<T> Async<T> {
505503
Err(err) if err.kind() == io::ErrorKind::WouldBlock => {}
506504
res => return Poll::Ready(res),
507505
}
508-
futures_util::ready!(poll_once(cx, self.writable()))?;
506+
ready!(poll_once(cx, self.writable()))?;
509507
Poll::Pending
510508
})
511509
.await
@@ -544,7 +542,7 @@ impl<T> Async<T> {
544542
Err(err) if err.kind() == io::ErrorKind::WouldBlock => {}
545543
res => return Poll::Ready(res),
546544
}
547-
futures_util::ready!(poll_once(cx, self.writable()))?;
545+
ready!(poll_once(cx, self.writable()))?;
548546
Poll::Pending
549547
})
550548
.await
@@ -1261,6 +1259,6 @@ impl Async<UnixDatagram> {
12611259

12621260
/// Pins a future and then polls it.
12631261
fn poll_once<T>(cx: &mut Context<'_>, fut: impl Future<Output = T>) -> Poll<T> {
1264-
futures_util::pin_mut!(fut);
1262+
pin!(fut);
12651263
fut.poll(cx)
12661264
}

src/parking.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ use std::thread;
2020
use std::time::{Duration, Instant};
2121

2222
use concurrent_queue::ConcurrentQueue;
23-
use futures_util::future;
23+
use futures_lite::*;
2424
use once_cell::sync::Lazy;
2525
use vec_arena::Arena;
2626

tests/async.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use std::time::Duration;
99

1010
use async_io::{Async, Timer};
1111
use blocking::block_on;
12-
use futures::{future, AsyncReadExt, AsyncWriteExt, StreamExt};
12+
use futures_lite::*;
1313
#[cfg(unix)]
1414
use tempfile::tempdir;
1515

0 commit comments

Comments
 (0)