summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBenjamin Sago <ogham@bsago.me>2015-12-15 21:47:37 +0000
committerBenjamin Sago <ogham@bsago.me>2015-12-15 21:47:37 +0000
commit95c0d63045875a0c41a124b1dc6ed7f738163316 (patch)
treef47a5536b7cf51dddf4102b1e8ec0411adc785ad /src
parentc39a57294ca97d5cab7859974e0c0b30c0cd787f (diff)
io::Result -> IOResult
Diffstat (limited to 'src')
-rw-r--r--src/dir.rs4
-rw-r--r--src/file.rs6
2 files changed, 5 insertions, 5 deletions
diff --git a/src/dir.rs b/src/dir.rs
index 78e0ed6..7453745 100644
--- a/src/dir.rs
+++ b/src/dir.rs
@@ -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)
}