Skip to content

Commit 945855c

Browse files
committed
migrate from runtime to async-std
1 parent b24f169 commit 945855c

File tree

4 files changed

+10
-8
lines changed

4 files changed

+10
-8
lines changed

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ Timeouts and intervals for futures.
1313
"""
1414

1515
[dependencies]
16-
futures-core = "0.3.0"
16+
futures-core = "0.3.1"
1717
pin-utils = "0.1.0-alpha.4"
1818

1919
[dev-dependencies]
20-
futures = "0.3.0"
21-
runtime = "0.3.0-alpha.8"
20+
async-std = { version = "1.0.1", features = ["attributes"] }
21+
futures = "0.3.1"

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//! # Examples
44
//!
55
//! ```no_run
6-
//! # #[runtime::main]
6+
//! # #[async_std::main]
77
//! # async fn main() {
88
//! use std::time::Duration;
99
//! use futures_timer::Delay;

tests/smoke.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,18 @@ use std::error::Error;
22
use std::pin::Pin;
33
use std::time::{Duration, Instant};
44

5+
use async_std;
56
use futures_timer::Delay;
67

7-
#[runtime::test]
8+
#[async_std::test]
89
async fn works() {
910
let i = Instant::now();
1011
let dur = Duration::from_millis(100);
1112
let _d = Delay::new(dur).await;
1213
assert!(i.elapsed() > dur);
1314
}
1415

15-
#[runtime::test]
16+
#[async_std::test]
1617
async fn reset() -> Result<(), Box<dyn Error + Send + Sync + 'static>> {
1718
let i = Instant::now();
1819
let dur = Duration::from_millis(100);

tests/timeout.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
use std::error::Error;
22
use std::time::{Duration, Instant};
33

4+
use async_std;
45
use futures_timer::Delay;
56

6-
#[runtime::test]
7+
#[async_std::test]
78
async fn smoke() -> Result<(), Box<dyn Error + Send + Sync + 'static>> {
89
let dur = Duration::from_millis(10);
910
let start = Instant::now();
@@ -12,7 +13,7 @@ async fn smoke() -> Result<(), Box<dyn Error + Send + Sync + 'static>> {
1213
Ok(())
1314
}
1415

15-
#[runtime::test]
16+
#[async_std::test]
1617
async fn two() -> Result<(), Box<dyn Error + Send + Sync + 'static>> {
1718
let dur = Duration::from_millis(10);
1819
Delay::new(dur).await;

0 commit comments

Comments
 (0)