mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-23 00:00:10 +02:00
process: Tweak docs and macro imports
This commit is contained in:
+1
-1
@@ -17,13 +17,13 @@ appveyor = { repository = "alexcrichton/tokio-process" }
|
||||
|
||||
[dependencies]
|
||||
futures = "0.1.11"
|
||||
log = "0.3"
|
||||
mio = "0.6.5"
|
||||
tokio-core = "0.1.6"
|
||||
tokio-io = "0.1"
|
||||
|
||||
[dev-dependencies]
|
||||
env_logger = { version = "0.3", default-features = false }
|
||||
log = "0.3"
|
||||
|
||||
[target.'cfg(windows)'.dependencies]
|
||||
winapi = "0.2"
|
||||
|
||||
+5
-9
@@ -79,13 +79,13 @@
|
||||
//! extern crate tokio_io;
|
||||
//!
|
||||
//! use std::io;
|
||||
//! use std::process::{Command, Stdio, Output};
|
||||
//! use std::process::{Command, Stdio, ExitStatus};
|
||||
//!
|
||||
//! use futures::{BoxFuture, Future, Stream};
|
||||
//! use tokio_core::reactor::Core;
|
||||
//! use tokio_process::{CommandExt, Child};
|
||||
//!
|
||||
//! fn get_lines(mut cat: Child) -> BoxFuture<((), Output), io::Error> {
|
||||
//! fn print_lines(mut cat: Child) -> BoxFuture<ExitStatus, io::Error> {
|
||||
//! let stdout = cat.stdout().take().unwrap();
|
||||
//! let reader = io::BufReader::new(stdout);
|
||||
//! let lines = tokio_io::io::lines(reader);
|
||||
@@ -93,17 +93,16 @@
|
||||
//! println!("Line: {}", l);
|
||||
//! Ok(())
|
||||
//! });
|
||||
//! cycle.join(cat.wait_with_output()).boxed()
|
||||
//! cycle.join(cat).map(|((), s)| s).boxed()
|
||||
//! }
|
||||
//!
|
||||
//! fn main() {
|
||||
//! let mut core = Core::new().unwrap();
|
||||
//! let mut cmd = Command::new("cat");
|
||||
//! let mut cat = cmd.stdout(Stdio::piped());
|
||||
//! let mut core = Core::new().unwrap();
|
||||
//! let child = cat.spawn_async(&core.handle()).unwrap();
|
||||
//! core.run(get_lines(child)).unwrap();
|
||||
//! core.run(print_lines(child)).unwrap();
|
||||
//! }
|
||||
//!
|
||||
//! ```
|
||||
//!
|
||||
//! # Caveats
|
||||
@@ -119,13 +118,10 @@
|
||||
#![deny(missing_docs)]
|
||||
#![doc(html_root_url = "https://docs.rs/tokio-process/0.1")]
|
||||
|
||||
#[macro_use]
|
||||
extern crate futures;
|
||||
extern crate tokio_core;
|
||||
extern crate tokio_io;
|
||||
extern crate mio;
|
||||
#[macro_use]
|
||||
extern crate log;
|
||||
|
||||
use std::ffi::OsStr;
|
||||
use std::io::{self, Read, Write};
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
extern crate futures;
|
||||
#[macro_use]
|
||||
extern crate tokio_core;
|
||||
extern crate tokio_io;
|
||||
extern crate tokio_process;
|
||||
|
||||
Reference in New Issue
Block a user