diff options
| author | bors <bors@rust-lang.org> | 2015-03-24 17:38:09 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2015-03-24 17:38:09 +0000 |
| commit | ed810385045ab0db90303574ba3ea47dfa2a36d5 (patch) | |
| tree | 161242c800aca625a26c56551fa5adb446c0089f /src/libstd/process.rs | |
| parent | 28a0b25f424090255966273994748a9f9901059f (diff) | |
| parent | d252d0ad5434bcf77076729ab766eeff98f20ead (diff) | |
| download | rust-ed810385045ab0db90303574ba3ea47dfa2a36d5.tar.gz rust-ed810385045ab0db90303574ba3ea47dfa2a36d5.zip | |
Auto merge of #23654 - alexcrichton:rollup, r=alexcrichton
Diffstat (limited to 'src/libstd/process.rs')
| -rw-r--r-- | src/libstd/process.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libstd/process.rs b/src/libstd/process.rs index 6b09636c1df..553412c8371 100644 --- a/src/libstd/process.rs +++ b/src/libstd/process.rs @@ -19,8 +19,8 @@ use io::prelude::*; use ffi::AsOsStr; use fmt; use io::{self, Error, ErrorKind}; -use path::AsPath; use libc; +use path; use sync::mpsc::{channel, Receiver}; use sys::pipe2::{self, AnonPipe}; use sys::process2::Process as ProcessImp; @@ -198,8 +198,8 @@ impl Command { /// Set the working directory for the child process. #[stable(feature = "process", since = "1.0.0")] - pub fn current_dir<P: AsPath>(&mut self, dir: P) -> &mut Command { - self.inner.cwd(dir.as_path().as_os_str()); + pub fn current_dir<P: AsRef<path::Path>>(&mut self, dir: P) -> &mut Command { + self.inner.cwd(dir.as_ref().as_os_str()); self } @@ -770,7 +770,7 @@ mod tests { // test changing to the parent of os::getcwd() because we know // the path exists (and os::getcwd() is not expected to be root) let parent_dir = os::getcwd().unwrap().dir_path(); - let result = pwd_cmd().current_dir(&parent_dir).output().unwrap(); + let result = pwd_cmd().current_dir(parent_dir.as_str().unwrap()).output().unwrap(); let output = String::from_utf8(result.stdout).unwrap(); let child_dir = old_path::Path::new(output.trim()); |
