Clean up FileType enum following enum namespacing

All of the enum components had a redundant 'Type' specifier: TypeSymlink, TypeDirectory, TypeFile. This change removes them, replacing them with a namespace: FileType::Symlink, FileType::Directory, and FileType::RegularFile.

RegularFile is used instead of just File, as File by itself could be mistakenly thought of as referring to the struct.

[breaking-change]
This commit is contained in:
Ben S 2014-11-24 19:04:54 +00:00
parent 4334d3c196
commit 3b9dfd6af0
6 changed files with 35 additions and 36 deletions

View file

@ -37,7 +37,7 @@ pub fn realpath(original: &Path) -> io::IoResult<Path> {
match fs::lstat(&result) {
Err(..) => break,
Ok(ref stat) if stat.kind != io::TypeSymlink => break,
Ok(ref stat) if stat.kind != io::FileType::Symlink => break,
Ok(..) => {
followed += 1;
let path = try!(fs::readlink(&result));