about summary refs log tree commit diff
diff options
context:
space:
mode:
authorManish Goregaokar <manishsmail@gmail.com>2015-02-25 12:48:14 +0530
committerManish Goregaokar <manishsmail@gmail.com>2015-02-25 12:48:14 +0530
commit9f8a1cb38d4d6dd16291aa0fd9f19e93e5263028 (patch)
treef0604ebcbd4cff2f83eb52ce03cc7d098355a704
parentf8e4fcb38c2ab0b5180c8fff35ad0454eb0667d7 (diff)
downloadrust-9f8a1cb38d4d6dd16291aa0fd9f19e93e5263028.tar.gz
rust-9f8a1cb38d4d6dd16291aa0fd9f19e93e5263028.zip
Use os::getcwd instead of env in rustbook (fixup #22727)
-rw-r--r--src/rustbook/build.rs5
-rw-r--r--src/rustbook/main.rs1
-rw-r--r--src/rustbook/test.rs4
3 files changed, 6 insertions, 4 deletions
diff --git a/src/rustbook/build.rs b/src/rustbook/build.rs
index 9f35bdaa367..f36d97d6d12 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::env;
+use std::os;
 use std::old_io;
 use std::old_io::{fs, File, BufferedWriter, TempDir, IoResult};
 
@@ -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());
         }
@@ -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;
 
diff --git a/src/rustbook/main.rs b/src/rustbook/main.rs
index 68e4ba54d94..b9fc011e8b9 100644
--- a/src/rustbook/main.rs
+++ b/src/rustbook/main.rs
@@ -13,6 +13,7 @@
 #![feature(core)]
 #![feature(old_io)]
 #![feature(env)]
+#![feature(os)]
 #![feature(old_path)]
 #![feature(rustdoc)]
 
diff --git a/src/rustbook/test.rs b/src/rustbook/test.rs
index bff366163dc..727a385a8f0 100644
--- a/src/rustbook/test.rs
+++ b/src/rustbook/test.rs
@@ -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;
 
@@ -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"));