Skip to content

Commit 039f1b8

Browse files
committed
Re-export task::spawn and task::spawn_blocking at top-level
These are fundamental operations that crates will use constantly; make it possible to write `async_std::spawn` or `async_std::spawn_blocking` to make examples and tests easier to write without requiring as many `use` lines.
1 parent 07ba24c commit 039f1b8

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/lib.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,11 @@ cfg_default! {
318318
pub mod net;
319319
#[cfg(not(target_os = "unknown"))]
320320
pub(crate) mod rt;
321+
322+
#[cfg(not(target_os = "unknown"))]
323+
pub use std::task::spawn;
324+
#[cfg(not(target_os = "unknown"))]
325+
pub use std::task::spawn_blocking;
321326
}
322327

323328
cfg_unstable! {

0 commit comments

Comments
 (0)