Browse Source

current_dir -> getcwd

current_dir returns a new PathBuf, but getcwd returns an old Path. One day I'll have to upgrade to the new Path library. One day.

Fixes #41.
Ben S 11 years ago
parent
commit
027ca60d90
2 changed files with 3 additions and 3 deletions
  1. 2 2
      src/file.rs
  2. 1 1
      src/main.rs

+ 2 - 2
src/file.rs

@@ -1,7 +1,7 @@
 use std::old_io::{fs, IoResult};
 use std::old_io as io;
 use std::ascii::AsciiExt;
-use std::env::current_dir;
+use std::os::getcwd;
 
 use ansi_term::{ANSIString, ANSIStrings, Colour, Style};
 use ansi_term::Style::Plain;
@@ -451,7 +451,7 @@ impl<'a> File<'a> {
 
     fn git_status(&self) -> Cell {
         let status = match self.dir {
-            Some(d) => d.git_status(&current_dir().unwrap_or(Path::new(".")).join(&self.path),
+            Some(d) => d.git_status(&getcwd().unwrap_or(Path::new(".")).join(&self.path),
                                     self.is_directory()),
             None    => GREY.paint("--").to_string(),
         };

+ 1 - 1
src/main.rs

@@ -1,4 +1,4 @@
-#![feature(collections, core, env, io, libc, old_io, old_path, std_misc)]
+#![feature(collections, core, env, io, libc, old_io, old_path, os, std_misc)]
 
 // Other platforms than macos don't need std_misc but you can't
 // use #[cfg] on features.