diff --git a/crates/wasi-common/src/pipe.rs b/crates/wasi-common/src/pipe.rs index ccad53c39536..9e70e20bd3ed 100644 --- a/crates/wasi-common/src/pipe.rs +++ b/crates/wasi-common/src/pipe.rs @@ -17,13 +17,14 @@ use std::sync::{Arc, RwLock}; /// /// A variety of `From` impls are provided so that common pipe types are easy to create. For example: /// -/// ```no_run +/// ```rust /// use wasi_common::{pipe::ReadPipe, WasiCtx, Table}; /// let stdin = ReadPipe::from("hello from stdin!"); -/// // Brint these instances from elsewhere (e.g. wasi-cap-std-sync): -/// let random = todo!(); -/// let clocks = todo!(); -/// let sched = todo!(); +/// // Bring these instances from elsewhere (e.g. wasi-cap-std-sync or wasi-cap-std-tokio): +/// use wasi_common::sync::{random_ctx, clocks_ctx, sched_ctx}; +/// let random = random_ctx(); +/// let clocks = clocks_ctx(); +/// let sched = sched_ctx(); /// let table = Table::new(); /// let mut ctx = WasiCtx::new(random, clocks, sched, table); /// ctx.set_stdin(Box::new(stdin.clone())); @@ -113,13 +114,14 @@ impl WasiFile for ReadPipe { /// A virtual pipe write end. /// -/// ```no_run +/// ```rust /// use wasi_common::{pipe::WritePipe, WasiCtx, Table}; /// let stdout = WritePipe::new_in_memory(); -/// // Brint these instances from elsewhere (e.g. wasi-cap-std-sync): -/// let random = todo!(); -/// let clocks = todo!(); -/// let sched = todo!(); +/// // Bring these instances from elsewhere (e.g. wasi-cap-std-sync or wasi-cap-std-tokio): +/// use wasi_common::sync::{random_ctx, clocks_ctx, sched_ctx}; +/// let random = random_ctx(); +/// let clocks = clocks_ctx(); +/// let sched = sched_ctx(); /// let table = Table::new(); /// let mut ctx = WasiCtx::new(random, clocks, sched, table); /// ctx.set_stdout(Box::new(stdout.clone()));