Skip to content

Commit 98e7689

Browse files
authored
Merge pull request #46 from marcelbuesing/master
migrate from runtime to async-std
2 parents 8a8c414 + ac4834f commit 98e7689

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ use std::time::{Duration, Instant};
44

55
use futures_timer::Delay;
66

7-
#[runtime::test]
7+
#[async_std::test]
88
async fn works() {
99
let i = Instant::now();
1010
let dur = Duration::from_millis(100);
1111
let _d = Delay::new(dur).await;
1212
assert!(i.elapsed() > dur);
1313
}
1414

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

tests/timeout.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use std::time::{Duration, Instant};
33

44
use futures_timer::Delay;
55

6-
#[runtime::test]
6+
#[async_std::test]
77
async fn smoke() -> Result<(), Box<dyn Error + Send + Sync + 'static>> {
88
let dur = Duration::from_millis(10);
99
let start = Instant::now();
@@ -12,7 +12,7 @@ async fn smoke() -> Result<(), Box<dyn Error + Send + Sync + 'static>> {
1212
Ok(())
1313
}
1414

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

0 commit comments

Comments
 (0)