Skip to content

Commit

Permalink
Use os::getcwd instead of env in rustbook (fixup rust-lang#22727)
Browse files Browse the repository at this point in the history
  • Loading branch information
Manishearth committed Feb 25, 2015
1 parent f8e4fcb commit 9f8a1cb
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/rustbook/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
//! Implementation of the `build` subcommand, used to compile a book.
use std::env;
use std::os;
use std::old_io;
use std::old_io::{fs, File, BufferedWriter, TempDir, IoResult};

Expand Down Expand Up @@ -81,7 +82,7 @@ fn render(book: &Book, tgt: &Path) -> CliResult<()> {

let src;
if env::args().len() < 3 {
src = env::current_dir().unwrap().clone();
src = os::getcwd().unwrap().clone();
} else {
src = Path::new(env::args().nth(2).unwrap().clone());
}
Expand Down Expand Up @@ -149,7 +150,7 @@ impl Subcommand for Build {
}
fn usage(&self) {}
fn execute(&mut self, term: &mut Term) -> CommandResult<()> {
let cwd = env::current_dir().unwrap();
let cwd = os::getcwd().unwrap();
let src;
let tgt;

Expand Down
1 change: 1 addition & 0 deletions src/rustbook/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#![feature(core)]
#![feature(old_io)]
#![feature(env)]
#![feature(os)]
#![feature(old_path)]
#![feature(rustdoc)]

Expand Down
4 changes: 2 additions & 2 deletions src/rustbook/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use error::Error;
use term::Term;
use book;
use std::old_io::{Command, File};
use std::env;
use std::os;

struct Test;

Expand All @@ -35,7 +35,7 @@ impl Subcommand for Test {
}
fn usage(&self) {}
fn execute(&mut self, term: &mut Term) -> CommandResult<()> {
let cwd = env::current_dir().unwrap();
let cwd = os::getcwd().unwrap();
let src = cwd.clone();

let summary = File::open(&src.join("SUMMARY.md"));
Expand Down

0 comments on commit 9f8a1cb

Please sign in to comment.