diff options
| author | Huon Wilson <dbau.pp+github@gmail.com> | 2015-02-18 23:50:21 +1100 |
|---|---|---|
| committer | Huon Wilson <dbau.pp+github@gmail.com> | 2015-02-18 23:50:21 +1100 |
| commit | dfc5c0f1e8799f47f9033bdcc8a7cd8a217620a5 (patch) | |
| tree | e9c32f2e58b3462a23dd9c472d2f236640b78811 /src/rustbook | |
| parent | 6c065fc8cb036785f61ff03e05c1563cbb2dd081 (diff) | |
| parent | 47f91a9484eceef10536d4caac6ef578cd254567 (diff) | |
| download | rust-dfc5c0f1e8799f47f9033bdcc8a7cd8a217620a5.tar.gz rust-dfc5c0f1e8799f47f9033bdcc8a7cd8a217620a5.zip | |
Manual merge of #22475 - alexcrichton:rollup, r=alexcrichton
One windows bot failed spuriously.
Diffstat (limited to 'src/rustbook')
| -rw-r--r-- | src/rustbook/build.rs | 13 | ||||
| -rw-r--r-- | src/rustbook/main.rs | 9 | ||||
| -rw-r--r-- | src/rustbook/term.rs | 4 |
3 files changed, 14 insertions, 12 deletions
diff --git a/src/rustbook/build.rs b/src/rustbook/build.rs index 3c9c4bdedcc..6f5fc5c1969 100644 --- a/src/rustbook/build.rs +++ b/src/rustbook/build.rs @@ -11,6 +11,7 @@ //! Implementation of the `build` subcommand, used to compile a book. use std::os; +use std::env; use std::old_io; use std::old_io::{fs, File, BufferedWriter, TempDir, IoResult}; @@ -80,10 +81,10 @@ fn render(book: &Book, tgt: &Path) -> CliResult<()> { let out_path = tgt.join(item.path.dirname()); let src; - if os::args().len() < 3 { + if env::args().len() < 3 { src = os::getcwd().unwrap().clone(); } else { - src = Path::new(os::args()[2].clone()); + src = Path::new(env::args().nth(2).unwrap().clone()); } // preprocess the markdown, rerouting markdown references to html references let markdown_data = try!(File::open(&src.join(&item.path)).read_to_string()); @@ -153,16 +154,16 @@ impl Subcommand for Build { let src; let tgt; - if os::args().len() < 3 { + if env::args().len() < 3 { src = cwd.clone(); } else { - src = Path::new(os::args()[2].clone()); + src = Path::new(env::args().nth(2).unwrap().clone()); } - if os::args().len() < 4 { + if env::args().len() < 4 { tgt = cwd.join("_book"); } else { - tgt = Path::new(os::args()[3].clone()); + tgt = Path::new(env::args().nth(3).unwrap().clone()); } try!(fs::mkdir(&tgt, old_io::USER_DIR)); diff --git a/src/rustbook/main.rs b/src/rustbook/main.rs index a8466465f87..ace57f0ac2c 100644 --- a/src/rustbook/main.rs +++ b/src/rustbook/main.rs @@ -11,14 +11,15 @@ #![feature(box_syntax)] #![feature(collections)] #![feature(core)] -#![feature(io)] +#![feature(old_io)] #![feature(os)] -#![feature(path)] +#![feature(env)] +#![feature(old_path)] #![feature(rustdoc)] extern crate rustdoc; -use std::os; +use std::env; use subcommand::Subcommand; use term::Term; @@ -48,7 +49,7 @@ mod javascript; #[cfg(not(test))] // thanks #12327 fn main() { let mut term = Term::new(); - let cmd = os::args(); + let cmd: Vec<_> = env::args().collect(); if cmd.len() <= 1 { help::usage() diff --git a/src/rustbook/term.rs b/src/rustbook/term.rs index b922bf1cdd3..98aa3fca184 100644 --- a/src/rustbook/term.rs +++ b/src/rustbook/term.rs @@ -11,7 +11,7 @@ //! An abstraction of the terminal. Eventually, provide color and //! verbosity support. For now, just a wrapper around stdout/stderr. -use std::os; +use std::env; use std::old_io::stdio; pub struct Term { @@ -28,6 +28,6 @@ impl Term { pub fn err(&mut self, msg: &str) { // swallow any errors let _ = self.err.write_line(msg); - os::set_exit_status(101); + env::set_exit_status(101); } } |
