redox: remove uses of Unix-only things

The code for `cfg(not(any(unix, windows)))` is untested and contained a few
errors that this commit cleans up.
This commit is contained in:
Andrew Gallant 2018-06-13 12:13:02 -04:00 committed by GitHub
commit 4b21b55f21
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1108,8 +1108,6 @@ impl DirEntry {
#[cfg(not(any(unix, windows)))]
fn from_entry(depth: usize, ent: &fs::DirEntry) -> Result<DirEntry> {
use std::os::unix::fs::DirEntryExt;
let ty = ent.file_type().map_err(|err| {
Error::from_path(depth, ent.path(), err)
})?;
@ -1153,8 +1151,6 @@ impl DirEntry {
#[cfg(not(any(unix, windows)))]
fn from_link(depth: usize, pb: PathBuf) -> Result<DirEntry> {
use std::os::unix::fs::MetadataExt;
let md = fs::metadata(&pb).map_err(|err| {
Error::from_path(depth, pb.clone(), err)
})?;
@ -1197,7 +1193,6 @@ impl Clone for DirEntry {
ty: self.ty,
follow_link: self.follow_link,
depth: self.depth,
ino: self.ino,
}
}
}