simplify the cfg in ReadDir construction
Co-authored-by: David Tolnay <dtolnay@gmail.com>
This commit is contained in:
parent
365e00aeee
commit
1d06b07765
1 changed files with 6 additions and 8 deletions
|
@ -949,18 +949,16 @@ pub fn readdir(p: &Path) -> io::Result<ReadDir> {
|
||||||
Err(Error::last_os_error())
|
Err(Error::last_os_error())
|
||||||
} else {
|
} else {
|
||||||
let inner = InnerReadDir { dirp: Dir(ptr), root };
|
let inner = InnerReadDir { dirp: Dir(ptr), root };
|
||||||
cfg_if::cfg_if! {
|
Ok(ReadDir {
|
||||||
if #[cfg(not(any(
|
inner: Arc::new(inner),
|
||||||
|
#[cfg(not(any(
|
||||||
target_os = "solaris",
|
target_os = "solaris",
|
||||||
target_os = "illumos",
|
target_os = "illumos",
|
||||||
target_os = "fuchsia",
|
target_os = "fuchsia",
|
||||||
target_os = "redox",
|
target_os = "redox",
|
||||||
)))] {
|
)))]
|
||||||
Ok(ReadDir { inner: Arc::new(inner), end_of_stream: false })
|
end_of_stream: false,
|
||||||
} else {
|
})
|
||||||
Ok(ReadDir { inner: Arc::new(inner) })
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue