Skip to content

Commit

Permalink
fs: always try to get file type in fs::read_dir
Browse files Browse the repository at this point in the history
  • Loading branch information
icedrocket committed Jun 19, 2023
1 parent 848482d commit 124761e
Showing 1 changed file with 0 additions and 18 deletions.
18 changes: 0 additions & 18 deletions tokio/src/fs/read_dir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,12 +135,6 @@ impl ReadDir {
let success = ret.is_ok();

buf.push_back(ret.map(|std| DirEntry {
#[cfg(not(any(
target_os = "solaris",
target_os = "illumos",
target_os = "haiku",
target_os = "vxworks"
)))]
file_type: std.file_type().ok(),
std: Arc::new(std),
}));
Expand Down Expand Up @@ -196,12 +190,6 @@ feature! {
/// path or possibly other metadata through per-platform extension traits.
#[derive(Debug)]
pub struct DirEntry {
#[cfg(not(any(
target_os = "solaris",
target_os = "illumos",
target_os = "haiku",
target_os = "vxworks"
)))]
file_type: Option<FileType>,
std: Arc<std::fs::DirEntry>,
}
Expand Down Expand Up @@ -327,12 +315,6 @@ impl DirEntry {
/// # }
/// ```
pub async fn file_type(&self) -> io::Result<FileType> {
#[cfg(not(any(
target_os = "solaris",
target_os = "illumos",
target_os = "haiku",
target_os = "vxworks"
)))]
if let Some(file_type) = self.file_type {
return Ok(file_type);
}
Expand Down

0 comments on commit 124761e

Please sign in to comment.