Skip to content

Commit e885063

Browse files
committed
promote task to top level too
1 parent 25fb8eb commit e885063

File tree

7 files changed

+7
-8
lines changed

7 files changed

+7
-8
lines changed

src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ pub mod net;
5656
pub mod rand;
5757
pub mod runtime;
5858
pub mod stream;
59+
pub mod task;
5960
pub mod time;
6061

6162
pub use wstd_macro::attr_macro_main as main;
File renamed without changes.
File renamed without changes.
File renamed without changes.

src/time/duration.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
use super::{task::Sleep, Instant};
1+
use super::Instant;
22
use crate::stream::{Interval, IntoStream};
3+
use crate::task::Sleep;
34
use std::future::IntoFuture;
45
use std::ops::{Add, AddAssign, Sub, SubAssign};
56
use wasi::clocks::monotonic_clock;
@@ -138,7 +139,7 @@ impl IntoFuture for Duration {
138139
type IntoFuture = Sleep;
139140

140141
fn into_future(self) -> Self::IntoFuture {
141-
super::task::sleep(self)
142+
crate::task::sleep(self)
142143
}
143144
}
144145

src/time/instant.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
use super::task::SleepUntil;
1+
use super::Duration;
2+
use crate::task::SleepUntil;
23
use std::future::IntoFuture;
34
use std::ops::{Add, AddAssign, Sub, SubAssign};
45
use wasi::clocks::monotonic_clock;
56

6-
use super::Duration;
7-
87
/// A measurement of a monotonically nondecreasing clock. Opaque and useful only
98
/// with Duration.
109
///
@@ -78,6 +77,6 @@ impl IntoFuture for Instant {
7877
type IntoFuture = SleepUntil;
7978

8079
fn into_future(self) -> Self::IntoFuture {
81-
super::task::sleep_until(self)
80+
crate::task::sleep_until(self)
8281
}
8382
}

src/time/mod.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ mod instant;
77
pub use duration::Duration;
88
pub use instant::Instant;
99

10-
pub mod task;
11-
1210
use std::future::Future;
1311
use std::pin::Pin;
1412
use std::task::{Context, Poll};

0 commit comments

Comments
 (0)