Use os::getcwd instead of env in rustbook (fixup #22727)

This commit is contained in:
Manish Goregaokar 2015-02-25 12:48:14 +05:30
parent f8e4fcb38c
commit 9f8a1cb38d
3 changed files with 6 additions and 4 deletions

View file

@ -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 @@ fn parse_args(&mut self, _: &[String]) -> CliResult<()> {
}
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;

View file

@ -13,6 +13,7 @@
#![feature(core)]
#![feature(old_io)]
#![feature(env)]
#![feature(os)]
#![feature(old_path)]
#![feature(rustdoc)]

View file

@ -17,7 +17,7 @@
use term::Term;
use book;
use std::old_io::{Command, File};
use std::env;
use std::os;
struct Test;
@ -35,7 +35,7 @@ fn parse_args(&mut self, _: &[String]) -> CliResult<()> {
}
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"));