diff options
-rw-r--r-- | src/dir.rs | 4 | ||||
-rw-r--r-- | src/file.rs | 6 |
2 files changed, 5 insertions, 5 deletions
@@ -1,4 +1,4 @@ -use std::io; +use std::io::{self, Result as IOResult}; use std::fs; use std::path::{Path, PathBuf}; use std::slice::Iter as SliceIter; @@ -32,7 +32,7 @@ impl Dir { /// pointed to by the given path. Fails if the directory can't be read, or /// isn't actually a directory, or if there's an IO error that occurs /// while scanning. - pub fn read_dir(path: &Path, git: bool) -> io::Result<Dir> { + pub fn read_dir(path: &Path, git: bool) -> IOResult<Dir> { let reader = try!(fs::read_dir(path)); let contents = try!(reader.map(|e| e.map(|e| e.path())).collect()); diff --git a/src/file.rs b/src/file.rs index e851405..08c45bb 100644 --- a/src/file.rs +++ b/src/file.rs @@ -3,7 +3,7 @@ use std::ascii::AsciiExt; use std::env::current_dir; use std::fs; -use std::io; +use std::io::Result as IOResult; use std::os::unix::fs::{MetadataExt, PermissionsExt}; use std::path::{Component, Path, PathBuf}; @@ -89,7 +89,7 @@ impl<'dir> File<'dir> { /// /// This uses `symlink_metadata` instead of `metadata`, which doesn't /// follow symbolic links. - pub fn from_path(path: &Path, parent: Option<&'dir Dir>) -> io::Result<File<'dir>> { + pub fn from_path(path: &Path, parent: Option<&'dir Dir>) -> IOResult<File<'dir>> { fs::symlink_metadata(path).map(|metadata| File::with_metadata(metadata, path, parent)) } @@ -117,7 +117,7 @@ impl<'dir> File<'dir> { /// /// Returns an IO error upon failure, but this shouldn't be used to check /// if a `File` is a directory or not! For that, just use `is_directory()`. - pub fn to_dir(&self, scan_for_git: bool) -> io::Result<Dir> { + pub fn to_dir(&self, scan_for_git: bool) -> IOResult<Dir> { Dir::read_dir(&*self.path, scan_for_git) } |